Skip to content

Commit 3dd5517

Browse files
authored
Merge pull request #117 from darshan-uber/main
fix: add check for element presence in "checkIfInteractive" utility
2 parents a53fc88 + e6c3702 commit 3dd5517

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

.changeset/spotty-pears-agree.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-movable": patch
3+
---
4+
5+
add check for element presence in "checkIfInteractive" utility

src/utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ export function checkIfInteractive(target: Element, rootElement: Element) {
120120
"switch",
121121
"tab",
122122
];
123+
if (!target || !rootElement) return false;
124+
123125
while (target !== rootElement) {
124126
if (target.getAttribute("data-movable-handle")) {
125127
return false;

0 commit comments

Comments
 (0)