mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-10-12 23:37:00 +08:00
fix(core-app): CB-1149 use props object instead of callback arguments
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user