Skip to content

Commit 3caa35b

Browse files
committed
[@mantine/hooks] use-focus-within: Fix event handlers not being cleaned up properly (#8507)
1 parent b6ce567 commit 3caa35b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/@mantine/hooks/src/use-focus-within/use-focus-within.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export function useFocusWithin<T extends HTMLElement = any>({
6464

6565
node.addEventListener('focusin', handleFocusIn);
6666
node.addEventListener('focusout', handleFocusOut);
67+
previousNode.current = node;
6768
},
6869
[handleFocusIn, handleFocusOut]
6970
);

0 commit comments

Comments
 (0)