You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
some time. when move block from one column to top another, browser catch error in console Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node..
After this error app broken and need reload page.
on sorting update component state and submit new order to server(websocket).
when server response(also with ws) sortable component recive new props with updated order
if onChange callback wrapped with setTimeout - catch more often error.
Not sure if it's caused by multiple sortable instances while mounting/unmounting component. I made an update in v1.0.1 that will remove the instance in componentWillUnmount. Hope this will work for you.
I am getting the same error: NotFoundError: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node
I have two image galleries that users can sort and drag/drop images between. I only seem to get this error when I try to pull an image from one gallery to the other within the first 5-6 seconds after the page loads.
The "onChange" method relied on Sortable's onStart event to remember the original position of a draggable element. The "nextSibling" variable is used to store the next sibling of the draggable element.
In normal circumstances, the onStart event should be fired immediately when dragging an item. However, if you do drag & drop very fast, the onStart event may be fired after dropping to the target container, and then evt.item will become an item in the target container as well. In that case, it's not possible to find the original dragging position due to a delayed onStart event.
Replace onStart event with onChoose event might be a solutioin to it, unfortunately, the new onChoose event is only available in Sortable's latest master branch, not in sortablejs@1.4.2 on NPM. A new version release is necessary for binding new events.
I'm using react-sortablejs 1.2.0 and sortablejs 1.5.0-rc1 and still having this issue. Also on a recent version of Chrome (v55).
For now, I'm getting around this by marking the items as deleted, and then batching the deletes up into a deferred function. A style of display: none is applied to items marked as deleted, so the UI still appears to behave the same.
I have the latest version of sortablejs and react-sortablejs.
I am using multi-dragging with onChoose (i tried also with onStart), but no success.
I am getting the same error: Uncaught DOMException: Failed to execute 'insertBefore' on 'Node'
I had the same issue using sortablejs (not using react).
An error appears when all following conditions are met:
1)You have two nested sortable containers
2)option “pull:clone” is set at least on the parent container
3)You drag an item from the parent container into the nested container
I solved with a small modification of the sortablejs library.
I use newest version of sortablejs, 1.15.3, still can reproduce this issue.
When I select two discontinuous cards in a list, and drag them to another empty list. This will reproduce.
Activity
cheton commentedon Jun 25, 2016
The Node.insertBefore method:
For a controlled component, this line of code will move the draggable element from the target position back to the original position:
evt.fromis the parent of the draggable element.evt.itemis the draggable element.store.nextSiblingis the next sibling of the draggable element.First, could you try not making any state changes (i.e. do nothing) within the
onChangemethod and check if it still generates this error?If no errors being occurred, try the following:
cheton commentedon Jun 25, 2016
You can paste your sample code here that will be useful to find out what's going wrong.
anagami commentedon Jun 26, 2016
part of code
on sorting update component state and submit new order to server(websocket).
when server response(also with ws) sortable component recive new props with updated order
if
onChangecallback wrapped withsetTimeout- catch more often error.cheton commentedon Jun 27, 2016
Not sure if it's caused by multiple sortable instances while mounting/unmounting component. I made an update in v1.0.1 that will remove the instance in componentWillUnmount. Hope this will work for you.
anagami commentedon Jun 28, 2016
yes i have many columns and i sort card beetwen them
v1.0.1 - doesnt help
cheton commentedon Jun 28, 2016
If it's possible, could you create a zip archive that contains a workable example so that I can try to reproduce this issue from my side. Thanks.
brybrophy commentedon Oct 10, 2016
I am getting the same error: NotFoundError: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node
I have two image galleries that users can sort and drag/drop images between. I only seem to get this error when I try to pull an image from one gallery to the other within the first 5-6 seconds after the page loads.
brybrophy commentedon Oct 10, 2016
https://gist.github.com/brybrophy/fffa54f39e18f93e9a436f0cd4a3c5dc
Here is a gist with some of the code. I am using mobx for state management which is why there are actions and no this.setState's.
cheton commentedon Oct 14, 2016
The "onChange" method relied on Sortable's
onStartevent to remember the original position of a draggable element. The "nextSibling" variable is used to store the next sibling of the draggable element.https://github.com/cheton/react-sortable/blob/master/src/index.jsx#L38
In normal circumstances, the
onStartevent should be fired immediately when dragging an item. However, if you do drag & drop very fast, theonStartevent may be fired after dropping to the target container, and thenevt.itemwill become an item in the target container as well. In that case, it's not possible to find the original dragging position due to a delayed onStart event.Replace onStart event with onChoose event might be a solutioin to it, unfortunately, the new
onChooseevent is only available in Sortable's latest master branch, not in sortablejs@1.4.2 on NPM. A new version release is necessary for binding new events.sathishsoundharajan commentedon Nov 14, 2016
Hi, is this related (react/react#8025), if so please upgrade chrome, i persume it solves the issue.
cheton commentedon Nov 28, 2016
The latest version of sortablejs@1.5.0-rc1 should have resolved the problem. Has anyone tried it?
chipit24 commentedon Dec 7, 2016
I'm using react-sortablejs 1.2.0 and sortablejs 1.5.0-rc1 and still having this issue. Also on a recent version of Chrome (v55).
For now, I'm getting around this by marking the items as deleted, and then batching the deletes up into a deferred function. A style of
display: noneis applied to items marked as deleted, so the UI still appears to behave the same.Resolve an issue that failed to execute 'insertNode' on 'Node' (resolves
LucianHij commentedon Dec 5, 2019
I have the latest version of sortablejs and react-sortablejs.
I am using multi-dragging with onChoose (i tried also with onStart), but no success.
I am getting the same error:
Uncaught DOMException: Failed to execute 'insertBefore' on 'Node'RomualdoGrillo commentedon Apr 4, 2020
I had the same issue using sortablejs (not using react).
An error appears when all following conditions are met:
1)You have two nested sortable containers
2)option “pull:clone” is set at least on the parent container
3)You drag an item from the parent container into the nested container
I solved with a small modification of the sortablejs library.
I made a pull request with my small patch:
SortableJS/Sortable#1784
yich-wa commentedon Sep 24, 2024
I use newest version of sortablejs, 1.15.3, still can reproduce this issue.
When I select two discontinuous cards in a list, and drag them to another empty list. This will reproduce.