fix(core-app): CB-1149 use props object instead of callback arguments

This commit is contained in:
Naumov Alexey
2021-10-01 14:39:59 +03:00
parent 83e6642a7b
commit 50dfb28dcf
@@ -69,6 +69,7 @@ export const InlineEditor = observer<InlineEditorProps, HTMLInputElement | null>
onReject,
onSave,
value,
disableSave,
});
const commonDialogService = useService(CommonDialogService);
@@ -90,13 +91,13 @@ export const InlineEditor = observer<InlineEditorProps, HTMLInputElement | null>
const handleKeyDown = useCallback((event: React.KeyboardEvent<HTMLInputElement>) => {
switch (event.key) {
case 'Enter':
!disableSave && props.onSave();
!props.disableSave && props.onSave();
break;
case 'Escape':
props.onReject?.();
break;
}
}, [disableSave]);
}, []);
const inputRef = useRef<HTMLInputElement>(null);