Skip to content

Commit bcdecd4

Browse files
committed
[dashboard] Update Modal keydown event handler when props.{onClose,onEnter} are changed
1 parent 01c9518 commit bcdecd4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

components/dashboard/src/components/Modal.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ export default function Modal(props: {
4141
return () => {
4242
window.removeEventListener('keydown', handler);
4343
};
44-
}, []); // Empty array ensures that effect is only run on mount and unmount
44+
// eslint-disable-next-line react-hooks/exhaustive-deps
45+
}, [props.onClose, props.onEnter]);
4546

4647
if (!props.visible) {
4748
return null;

0 commit comments

Comments
 (0)