From 8028459abc5687630c6ded352e985f3d953c258e Mon Sep 17 00:00:00 2001 From: jjchiw Date: Thu, 1 May 2025 15:13:25 +0200 Subject: [PATCH 1/2] Update utils.ts --- src/utils.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/utils.ts b/src/utils.ts index 5a0d118..c9ff462 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -123,6 +123,9 @@ export function checkIfInteractive(target: Element, rootElement: Element) { if (!target || !rootElement) return false; while (target !== rootElement) { + if (!target) { + return false; + } if (target.getAttribute("data-movable-handle")) { return false; } From 147fa6950ebf723dc458e0ddecbc5ea6d2a58f6e Mon Sep 17 00:00:00 2001 From: jjchiw Date: Thu, 1 May 2025 15:46:00 +0200 Subject: [PATCH 2/2] Update utils.ts `checkInteractive` was crashing when a modal was over the list and it was pressed a _ctrl key_ like (command or ctrl). I am using MUI. I don't know if it happens with other modals. But the `while` in `checkInteractive` was going up until it get to the _html tag_ and it was breaking the `.getAttribute` This was only happening in chromium browsers --- src/utils.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/utils.ts b/src/utils.ts index c9ff462..3fb5a9c 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -126,6 +126,9 @@ export function checkIfInteractive(target: Element, rootElement: Element) { if (!target) { return false; } + if (target.tagName === 'HTML') { + return false; + } if (target.getAttribute("data-movable-handle")) { return false; }