Skip to content

yanjijiang-github/react-nested-sortable

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React-Sortablejs: Experiment for Nested Sortables

Notes to remember:

  • Make sure to set data-id Otherwise, it will not work.

Issue:

When sortable is nested, it works but throws the below error in the browser:

Sortable.js:1323 Uncaught TypeError: Cannot read property 'dispatchEvent' of null
    at _dispatchEvent (Sortable.js:1323)
    at Sortable._onDrop (Sortable.js:986)
    at Sortable.handleEvent (Sortable.js:1044)
_dispatchEvent @ Sortable.js:1323
_onDrop @ Sortable.js:986
handleEvent @ Sortable.js:1044

Solution:

I manage to fix this issue by changing the code in Sortable.js in sortablejs library below:

  rootEl.dispatchEvent(evt);

to

  if(rootEl) {
    rootEl.dispatchEvent(evt);
  }

I will make a pull request.

About

Experiment with react-sortablejs to have nested sortables

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 79.6%
  • HTML 16.0%
  • CSS 4.4%