Giter VIP home page Giter VIP logo

ember-shopify-draggable's People

Contributors

bakerac4 avatar bdami-gavant avatar billdami avatar ember-tomster avatar gspain-gavant avatar pgengler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ember-shopify-draggable's Issues

Curry item models in events for Draggables and Droppables

Right now the functionality of {{draggable-group}} and {{droppable-group}} are pretty bare-bones. They are good building blocks for more complex functionality, but on their own, they don't do much more than emitting the basic events when items are dragged and dropped.

One thing we can do to increase their usefulness is when events are emitted, instead of only sending an argument with the raw event to the action, also send along an optional "model" that is associated with the item that was dragged, dropped, etc.

For example:

<DroppableGroup
    @droppableActions={{hash
        dropped=(action "droppableDropped")
    }}
    as |Group|
>
    <Group.container as |Container|>
        <Container.dropzone as |Dropzone|}}
            <Dropzone.item @item={{item}}>{{item.name}}</Dropzone.item>
        </Container.dropzone>
        <Container.dropzone as |Dropzone|></Container.dropzone>
    </Group.container>
<DroppableGroup>
actions: {
    droppableDropped(event, item) {
        console.log(`The item/model that was dropped was ${item.name}`);
    }
}

Integration Testing Drag and Drop

Thanks for your work on this. Any chance you can add some examples of testing the drag and drop functionality? For example,

Given a list of 2 elements,
When I drag the first element to the second spot,
then the list is reordered
and the appropriate events fire.

SwapAnimation plugin can cause sortable items to become undraggable

With swapAnimation=true set on a {{sortable-group}}, dragging items within a list can cause items in the list to not be draggable. This seems to only occur if you perform fast drag operations, and possibly only when you release the drag before the swap animation finishes.

It could be that the reorder delay the swap animation introduces is causing our logic for tracking/syncing of the underlying items list array is being thrown off.

ResizeMirror plugin can cause orphaned mirror elements to appear

With resizeMirror=true set on a {{sortable-group}}, dragging items within a list can cause orphaned mirror elements to appear in the DOM and are "stuck", usually with incorrect dimensions. This seems to happen more often when drag operations happen in quick succession, or when dragging around really fast/wildly.

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.