@ -30,10 +30,10 @@ function ConfirmModal(props) {
useEffect(() => {
if (isOpen) {
bindShortcut('enter', onConfirm);
} else {
unbindShortcut('enter', onConfirm);
return () => unbindShortcut('enter', onConfirm);
}
}, [onConfirm]);
}, [isOpen, onConfirm]);
return (
<Modal
@ -56,8 +56,10 @@ function keyboardShortcuts(WrappedComponent) {
unbindShortcut = (key) => {
delete this._mousetrapBindings[key];
this._mousetrap.unbind(key);
if (this._mousetrap != null) {
unbindAllShortcuts = () => {