From f4d9ccaf08c328b7958e93f12bc6c3293a5dfbdb Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Sat, 17 Sep 2022 20:46:06 +0200 Subject: [PATCH] TextEntryField now blocks DEL key event --- src/editor/widgets/comment/TextEntryField.jsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/editor/widgets/comment/TextEntryField.jsx b/src/editor/widgets/comment/TextEntryField.jsx index 0754bc2..54e74f9 100644 --- a/src/editor/widgets/comment/TextEntryField.jsx +++ b/src/editor/widgets/comment/TextEntryField.jsx @@ -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} /> ) }