Skip to content

Commit 2dd6732

Browse files
authored
Fix IE11 "SCRIPT16389: Unspecified error." when dragging element
IE11 throws error "SCRIPT16389: Unspecified error." when dragging element after `Sortable.create(...)` was executed more than 1 time while in same page (without page reload). This issue happens also in Sortable earlier versions, and due to this error may stop Sortable functionality at all. Using `el.parentNode` for simplest fix checking if element sort of exists in DOM (by checking if parent element exists). Universal fix would be to use `document.body.contains(el)`, but I think it is too much here and would cause small performance impact, that's way fixing it is simple way.
1 parent 88838bf commit 2dd6732

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoS
177177
height,
178178
width;
179179

180-
if (el !== window && el !== getWindowScrollingElement()) {
180+
if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {
181181
elRect = el.getBoundingClientRect();
182182
top = elRect.top;
183183
left = elRect.left;

0 commit comments

Comments
 (0)