Skip to content

Commit

Permalink
Fix flickering of node in overlay with React concurrent mode (#305)
Browse files Browse the repository at this point in the history
  • Loading branch information
medihack authored May 29, 2021
1 parent ae398de commit d289274
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/two-terms-mate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@dnd-kit/core': patch
---

Hide the node in the overlay after the drop animation is finished. This prevents some flickering with React concurrent mode.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ export function useDropAnimation({
);

nodeAnimation.onfinish = () => {
node.style.display = 'none';

setDropAnimationComplete(true);

if (finalNode && dragSourceOpacity != null) {
Expand Down

0 comments on commit d289274

Please sign in to comment.