fix Enter key clearing selected text, fixes #1219
regressed in 7a479edc
This commit is contained in:
parent
8c160ed40c
commit
2d5788766a
|
@ -70,7 +70,9 @@
|
|||
if (found) {
|
||||
const target = $('.' + TARGET_CLASS);
|
||||
const cm = target.CodeMirror;
|
||||
(cm || target).focus();
|
||||
/* Since this runs in `keydown` event we have to delay focusing
|
||||
* to prevent CodeMirror from seeing and handling the key */
|
||||
setTimeout(() => (cm || target).focus());
|
||||
if (cm) {
|
||||
const {from, to} = cm.state.search.searchPos;
|
||||
cm.jumpToPos(from, to);
|
||||
|
|
Loading…
Reference in New Issue
Block a user