Comments (5)
I also think it's good to prevent manipulate DOM, but no one has merged PR and released a new version recently for this project. There is another idea I found in react-sortablejs that revert nodes to pre-drag position then change React state.
- record where the node is when start dragging
- put it back after dragging
- remove redundant nodes
- update state
from draggable.
Okay, I gave up on Dragula because it is too slow on mobile. I'll figure out how to make that event cancellable
from draggable.
I used to update the state (e.g.: items list array) when drag:stop
or drag:stopped
and then draggable elements re-rendered because the state changed. The above approach doesn't need to prevent or cancel any event, but it is not performant because all draggable elements are re-rendered after sorted.
from draggable.
I used to update the state (e.g.: items list array) when
drag:stop
ordrag:stopped
and then draggable elements re-rendered because the state changed. The above approach doesn't need to prevent or cancel any event, but it is not performant because all draggable elements are re-rendered after sorted.
I'm trying to do something similar, but I'm currently getting two instances of the same item into the list (Probably happens because Solid does not re-render the container, but only appends a new instance). It would be really good if preventing the new node from being appended were possible.
from draggable.
Good idea! I might try and take a look into the lib, however, looks like there are lots of PRs waiting to be merged and no updates on master for a long time :/. That's a bummer, I might as well give dragula a try, seems like it has a similar API
from draggable.
Related Issues (20)
- Manual discounts permission - Build use case scenarios for testing
- Draggable caught errors while triggering 'drag:over' HOT 1
- Links on https://shopify.github.io/draggable/ in Chromium browsers do nothing when clicked HOT 2
- Unable to start example in Windows 10 HOT 8
- The mirror element created at the wrong place when using flexbox HOT 1
- Does it make sense to replace AbstractEvent with CustomEvent? HOT 2
- Suggestion for cross OS
- Why Sensors trigger events in source container? HOT 4
- keyboard accessibility - feature request
- shopify theme
- Sortable with fixed Layout
- Analysis: 97% of dependency updates in this repository can be merged. HOT 2
- Add Carousal effect on the UI Hero section
- [BUG] - Multiple Container Sortable Bug on touch devices
- Option to set width/height to offsetWidth/Height on drag start HOT 1
- No keyboard accessibility = please add DO NOT USE ALERT HOT 1
- Duplicate Mirror gets created on iOS Safari if the draggable element contains a link
- Swappable:swap cancel async HOT 1
- Question - Sortable and Snappable
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from draggable.