fix(UX): Improve Enter key handling in PromptPopup input
This commit is contained in:
parent
2db5b3d72f
commit
8aba2f58c5
@ -71,7 +71,13 @@ const PromptPopupContainer: React.FC<Props> = ({
|
||||
value={value}
|
||||
onChange={(e) => setValue(e.target.value)}
|
||||
allowClear
|
||||
onPressEnter={onOk}
|
||||
onKeyDown={(e) => {
|
||||
const isEnterPressed = e.keyCode === 13
|
||||
if (isEnterPressed && !e.shiftKey && !e.ctrlKey && !e.metaKey) {
|
||||
e.preventDefault()
|
||||
onOk()
|
||||
}
|
||||
}}
|
||||
rows={1}
|
||||
{...inputProps}
|
||||
/>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user