Enter key handling for dialogs.

This commit is contained in:
Robin Davies
2024-10-08 04:20:37 -04:00
parent ebe56f4df9
commit a8061a6d15
31 changed files with 131 additions and 49 deletions
+14 -8
View File
@@ -166,15 +166,19 @@ const FullScreenIME =
}
}
onOk() {
if (this.inputChanged) {
this.inputChanged = false;
this.validateInput(true);
}
else {
this.props.onClose();
}
}
onInputKeyPress(e: any): void {
if (e.charCode === 13) {
if (this.inputChanged) {
this.inputChanged = false;
this.validateInput(true);
}
else {
this.props.onClose();
}
this.onOk();
}
}
@@ -196,7 +200,9 @@ const FullScreenIME =
let value = this.props.value;
return (
<DialogEx tag="ime" fullScreen open={!!(this.props.uiControl)} onClose={(e, r) => this.handleClose(e, r)} >
<DialogEx tag="ime" fullScreen open={!!(this.props.uiControl)} onClose={(e, r) => this.handleClose(e, r)}
onEnterKey={()=>{ /*nothing*/}}
>
<div style={{
width: "100%", height: "100%", position: "relative",
display: "flex", flexDirection: "column", flexWrap: "nowrap",