javascript - How can I get draft.js to recognize the escape key? -
i cancel input , clear field in app when user types escape key. tried testing e.which === 27 in keybindingfn, function never invoked when escape key pressed (it invoked fine normal keys, modifier keys, , arrow keys). how can detect escape keypress in draft.js?
editor component has onescape property
<editor editorstate={this.state.editorstate} onchange={this.onchange.bind(this)} onescape={keyevent=>console.log('escape pressed')} ref="editor" />
Comments
Post a Comment