TextEntryField now blocks DEL key event

This commit is contained in:
Rainer Simon 2022-09-17 20:46:06 +02:00
parent cb56d3a09f
commit f4d9ccaf08
1 changed files with 8 additions and 1 deletions

View File

@ -15,8 +15,14 @@ export default class TextEntryField extends Component {
// CTRL+Enter functions as Ok
onKeyDown = evt => {
if (evt.which === 13 && evt.ctrlKey)
if (evt.which === 13 && evt.ctrlKey) {
this.props.onSaveAndClose();
}
}
onKeyUp = evt => {
if (evt.which === 46)
evt.stopPropagation();
}
componentDidMount() {
@ -33,6 +39,7 @@ export default class TextEntryField extends Component {
placeholder={this.props.placeholder || i18n.t('Add a comment...')}
disabled={!this.props.editable}
onChange={this.props.onChange}
onKeyUp={this.onKeyUp}
onKeyDown={this.onKeyDown} />
)
}