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}
|
value={value}
|
||||||
onChange={(e) => setValue(e.target.value)}
|
onChange={(e) => setValue(e.target.value)}
|
||||||
allowClear
|
allowClear
|
||||||
onPressEnter={onOk}
|
onKeyDown={(e) => {
|
||||||
|
const isEnterPressed = e.keyCode === 13
|
||||||
|
if (isEnterPressed && !e.shiftKey && !e.ctrlKey && !e.metaKey) {
|
||||||
|
e.preventDefault()
|
||||||
|
onOk()
|
||||||
|
}
|
||||||
|
}}
|
||||||
rows={1}
|
rows={1}
|
||||||
{...inputProps}
|
{...inputProps}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user