Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
harshit078 committed Nov 7, 2024
2 parents 85967fb + 3be3065 commit ade1af4
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,14 @@ export const MultiItemFieldInput = <T,>({
onCancel?.();
};

const handleDropdownCloseOutside = (event: MouseEvent | TouchEvent) => {
onCancel?.();
event.stopImmediatePropagation();
};

useListenClickOutside({
refs: [containerRef],
callback: handleDropdownClose,
callback: handleDropdownCloseOutside,
});

useScopedHotkeys(Key.Escape, handleDropdownClose, hotkeyScope);
Expand Down

0 comments on commit ade1af4

Please sign in to comment.