Skip to content

Commit

Permalink
fix: do not close input editor on enter
Browse files Browse the repository at this point in the history
  • Loading branch information
barmac committed Sep 22, 2023
1 parent 596c952 commit 501acdd
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ export default class InputEditor extends Component {
return LiteralExpression;
}

/**
* Supress default menu closure on enter.
* @param {KeyboardEvent} event
*/
handleKeyDown = event => {
if (event.key === 'Enter') {
event.stopPropagation();
}
};

render() {

const {
Expand All @@ -54,7 +64,8 @@ export default class InputEditor extends Component {
const ExpressionEditor = this.getExpressionEditorComponent();

return (
<div className="context-menu-container ref-input-editor input-edit">
<div className="context-menu-container ref-input-editor input-edit"
onKeyDown={ this.handleKeyDown }>

<div className="dms-form-control">
<ContentEditable
Expand Down

0 comments on commit 501acdd

Please sign in to comment.