Skip to content

Commit b8f334d

Browse files
lauksteinbinyaminAtStampli
authored andcommitted
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 b60e11c commit b8f334d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/utils.ts

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

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

0 commit comments

Comments
 (0)