mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-01-24 07:16:52 -06:00
Fixed an issue to allow the Enter key to save data in the result grid text editor. #5307
This commit is contained in:
parent
0e63914ab3
commit
f0ecc95ca9
@ -246,11 +246,18 @@ export function TextEditor({row, column, onRowChange, onClose}) {
|
||||
}
|
||||
};
|
||||
|
||||
const onkeydown = (e)=>{
|
||||
// If only the Enter key is pressed, then save the changes.
|
||||
if(e.keyCode == 13 && !e.shiftKey) {
|
||||
onOK();
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<Portal container={document.body}>
|
||||
<ResizableDiv columnIndex={column.idx}
|
||||
className='Editors-textEditor' data-label="pg-editor" onKeyDown={suppressEnterKey} >
|
||||
<textarea ref={autoFocusAndSelect} className='Editors-textarea' value={localVal} onChange={onChange} />
|
||||
<textarea ref={autoFocusAndSelect} className='Editors-textarea' value={localVal} onChange={onChange} onKeyDown={onkeydown} />
|
||||
<Box display="flex" justifyContent="flex-end">
|
||||
<DefaultButton startIcon={<CloseIcon />} onClick={()=>onClose(false)} size="small">
|
||||
{gettext('Cancel')}
|
||||
|
Loading…
Reference in New Issue
Block a user