We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 249e728 commit fe0d19fCopy full SHA for fe0d19f
client/modules/IDE/components/Editor/index.jsx
@@ -193,6 +193,18 @@ class Editor extends React.Component {
193
if (/^[a-z]$/i.test(e.key) && (mode === 'css' || mode === 'javascript')) {
194
showHint(_cm, this.props.autocompleteHinter, this.props.fontSize);
195
}
196
+ if (e.key === 'Escape') {
197
+ console.log(this._cm);
198
+ e.preventDefault();
199
+ const selections = this._cm.listSelections();
200
+ if (selections.length > 1) {
201
+ const firstPos = selections[0].head || selections[0].anchor;
202
+ this._cm.setSelection(firstPos);
203
+ this._cm.scrollIntoView(firstPos);
204
+ } else {
205
+ this._cm.getInputField().blur();
206
+ }
207
208
});
209
210
this._cm.getWrapperElement().style[
0 commit comments