Comments (5)
@igorbrasileiro in addition to the code I shared above with memo
, making sure container doesn't re-render etc. I've added debounce like this on DndContext
: onDragOver={debounce(handleDragMove, 75)}
.
Going from my example, even though parent of ContentCard
doesn't re-render, useSortable
itself re-renders while dragging and affects the performance, as I've interpreted. So adding debounce to onDragOver
is like dropping down the FPS of drag movement a bit, 75 value felt like balanced between performance and user experience for me.
from dnd-kit.
Encountered this but got solved by wrapping whole component in memo() where the second argument is the function that checks if component should rerender.
from dnd-kit.
For people having similar usage and problem. In addition to using memo
I made performance manageable with removing items
array changes in onDragMove
, depending on DragOverlay
except when item changes between Sortable Containers
. And used debounce on onDragMove
. It cost a bit smoothness while dragging between containers tho.
from dnd-kit.
I'm facing the same issue @wdire , can you share the final idea of your code, to inspire me?
from dnd-kit.
@wdire personally I experienced issues with keeping track of items jumping over containers in a kanban layout while testing your debounce recommendation. For example jumping from container column 1 -> container column 3.
from dnd-kit.
Related Issues (20)
- rectSwappingStrategy has bad/unnecessary animation
- Element displacement when parent has transform property
- How would you find which sensor is active in a DndContext?
- Multi-Select by DND-Kit HOT 1
- Getting `aria-describedby` warning
- Dragging into sortable tree
- cross/multi container dnd using useSortable with a single context
- Unable to drag item backwards (Sandbox available) HOT 2
- Screen reader support for nested DndContext
- Example pages are not accessible HOT 5
- [ADVICE/HELP NEEDED] Maintain scroll position after collapsing accordions durign drag n drop HOT 1
- `DragOverlay` works but is invisible HOT 1
- Draggable Touch Events only working on Long Press
- `items` prop of SortableContext should be ReadonlyArray
- PointerSensor activationConstraint logs error on valid usage
- `createSnapModifier` should use `Math.round` instead of `Math.ceil`
- Clicking one draggable selects them all HOT 1
- Multiple `useSortable` within an `DndContext`
- Remove sortable item using keyboard shortcut?
- Cross-column dragging with asynchronous network requests can cause update status blocking, affecting the creation of the drag source.
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 dnd-kit.