gavant / ember-shopify-draggable Goto Github PK
View Code? Open in Web Editor NEWEmber addon for shopify's draggable.js
Home Page: https://gavant.github.io/ember-shopify-draggable/#/sortable
License: MIT License
Ember addon for shopify's draggable.js
Home Page: https://gavant.github.io/ember-shopify-draggable/#/sortable
License: MIT License
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:
actions: {
droppableDropped(event, item) {
console.log(`The item/model that was dropped was ${item.name}`);
}
}
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.
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.