Giter Club home page Giter Club logo

Comments (6)

davidmaxwaterman avatar davidmaxwaterman commented on June 29, 2024

I've had some success, but not there yet.

Some issues. I had to 'hack' polymer-dragula to find the template and add an event listener for dom-change, and only then add the container. I had to duplicate the style of the dragged item into the global style, including making it position: fixed, and some other adjustments. BTW, if I don't make it position: fixed, the positioning doesn't work and it is stuck at the top of the screen.

The issue that remains is that I am unable to 'drop'. When the item was not position: fixed, the drag item is at the top of the screen rather than under the cursor, then I can drop, but once it is positioned correctly, it isn't possible to drop it.

NB, if I add some 'tranform: translatex(-35px)', then it isn't under the cursor and I am able to drop the item.

Any ideas welcome.

from polymer-dragula.

ergo avatar ergo commented on June 29, 2024

I'm wondering, would turning off shadow DOM help here? Removing the <dom-module> tag could really make sense here.

from polymer-dragula.

davidmaxwaterman avatar davidmaxwaterman commented on June 29, 2024

Sorry, I don't quite understand. Shadow dom is inherent to web components, as is dom-module. I guess I'm misunderstanding you...could you explain a bit more?

from polymer-dragula.

ergo avatar ergo commented on June 29, 2024

You can remove this line with <dom-module> for your view controlling elements, then multiple elements should "see each other".
The more I work with polymer the more I see that for at least for "view elements" we should just create elements without shadow dom on. It solves some headaches related to styling, and cross component visibility.

from polymer-dragula.

sathish-pandian avatar sathish-pandian commented on June 29, 2024

Hi, do you have a demo showing how drag drop works on items created dynamically within a dom-repeat. Much appreciate your help on this.

from polymer-dragula.

maxiplay avatar maxiplay commented on June 29, 2024

it works for me in polymer 1.6 replacing <slot> by <content>

Good job man !
sample

`

    <polymer-dragula id="column-dragger" sub-container-selector=".col-holder" fn-moves="[[fnMovesInner]]">
        <polymer-dragula id="row-dragger" fn-moves="[[fnMoves]]">
            <div class="row-holder">
                <template is="dom-repeat-n" count="{{depth}}">
                    <div class="vertical">
                        <div class="col-holder">
                            <template is="dom-repeat" items="{{computeGetChildren(index)}}">
                                <div class="card">
                                    <strong class="handle-inner">drag handle</strong>
                                    <p>[[item.name]]</p>
                                </div>
                            </template>
                        </div>
                    </div>
                </template>
            </div>
        </polymer-dragula>
    </polymer-dragula>

`

from polymer-dragula.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.