Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: frontend-collective/react-sortable-tree
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: rabbiagency/react-sortable-tree
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 5 commits
  • 5 files changed
  • 2 contributors

Commits on Dec 8, 2022

  1. fix: hover/drop race conditions

    don't run hover animation frame after the drag has ended
    
    Description: 
    
    It's a copy of PR: #841
    
    I think I've found two race conditions where dragging nodes too quickly results in errors.
    
    Case 1: Uncaught TypeError: Cannot read property 'path' of null at dnd-manager.js:240
    
    How to reproduce:
    
    Open the "Minimal implementation" storybook in Chrome (I have reproduced this in Firefox, too, but it's a lot trickier)
    Enable 6x slowdown CPU throttling from DevTools
    Drag-and-drop the nodes around, trying to keep each drag as quick as possible
    Eventually you'll get error (in DevTools console) "Uncaught TypeError: Cannot read property 'path' of null at dnd-manager.js:240"
    Apparently what happens is that the animation frame code gets called after the drag is already over, and monitor.getItem() returns null.
    
    Case 2: Encountered two children with the same key warning from React
    
    How to reproduce:
    
    Open the "Callbacks" storybook (important: it has getNodeKey which uses ids) with Chrome
    Enable 6x slowdown CPU throttling from DevTools
    Drag-and-drop the nodes around, trying to keep each drag as quick as possible
    Eventually you'll get Warning: Encountered two children with the same key, 'nodeA'. from React
    It looks like drop has been called (so the dragged node has been added back to tree), but after the same animation frame code runs, "draggedNode" is set to the already-dropped node... which is then rendered again, and for a short duration (not visible), there are two nodes with same key in the tree...
    Hazantip authored Dec 8, 2022
    Configuration menu
    Copy the full SHA
    23cc131 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1 from rabbiagency/fix/hover-race-conditions

    fix: hover/drop race conditions
    Hazantip authored Dec 8, 2022
    Configuration menu
    Copy the full SHA
    4744a7b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1e5e729 View commit details
    Browse the repository at this point in the history
  4. "chore(release): 2.8.1"

    Hazantip committed Dec 8, 2022
    Configuration menu
    Copy the full SHA
    0b1bb71 View commit details
    Browse the repository at this point in the history

Commits on Jun 4, 2025

  1. chore: update README.md

    Hazantip authored Jun 4, 2025
    Configuration menu
    Copy the full SHA
    099bed6 View commit details
    Browse the repository at this point in the history
Loading