Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/ui/src/controlled-modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export const ControlledModal: MemoExoticComponentWithAs<ModalProps, 'dialog'> =
const { children, isOpen = false, handleClose, noAnimation = false, ...rest } = props;
const onCloseHandler = isOpen ? handleClose : () => null;

useOnClickOutside(_ref, isOpen ? onCloseHandler : null);
useOnClickOutside(_ref, onCloseHandler);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you go into more detail about why this needs to be the case? I made this change originally because having the handler always on is a significant performance drain.

useHotkeys('esc', onCloseHandler, [onCloseHandler]);

return (
Expand Down