Git Product home page Git Product logo

Comments (7)

dgavey avatar dgavey commented on September 24, 2024

Hey, unfortunately the addon doesn't currently work with horizontal lists. I had a PR before to fix it, but it broke vertical lists. I'd love to have a PR on it, but we will have to have a test, and the solution needs to work for both vertical and horizontal lists, or at least have a flag so the user can choose what kind of sorting to do. Another condition is that it most not break the ability on a vertical list to drag outside of the list and then back in without and still only swap the node it hovers over.

from ember-drag-drop.

dgavey avatar dgavey commented on September 24, 2024

Let me know if you can do a PR with a test, if not, it's high on my list of things to do for this addon.

from ember-drag-drop.

juanazam avatar juanazam commented on September 24, 2024

@dgavey I could reproduce this issue with the vertical list on the demo site (I used the ember data example). You just need to drag box 1 to box 3 without draggin over box 2. Anyway, I was using the addon as it is horizontally and it was behaving as expected except for this issue (that also happens vertically). Anyway I can to create tests for the horizontal case.

from ember-drag-drop.

dgavey avatar dgavey commented on September 24, 2024

Yes, that's not a bug in the vertical list, it's a feature. In a vertical list someone should be able to drag outside the list and swap with the other item. At least our use case for this benefits from it. It doesn't make sense for horizontal lists though. Which is why perhaps we should have the alternate sort behind a flag.

from ember-drag-drop.

juanazam avatar juanazam commented on September 24, 2024

Ok, got it, I agree that having a flag makes sense, but I'm not sure if vertical or horizontal flag is what we are looking for. I think we could make ir more general, we can let the user configure the swapping mechanism, so we would support the 'swap' mechanism and this other mechanism. I think this way is a bit better because someone might want to use any of these mechanism regardless of the list being vertical or horizontal.

Does this make sense?

from ember-drag-drop.

dgavey avatar dgavey commented on September 24, 2024

Yeah for sure, I think maybe something like allowSwap true/false. default to true (for backward compatibility)

from ember-drag-drop.

juanazam avatar juanazam commented on September 24, 2024

@dgavey makes sense, I will try to work on this soon and open a PR, thanks

from ember-drag-drop.

Related Issues (20)

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.