Skip to content

Commit 6f3293e

Browse files
committed
Fix flaky right-click menu behaviour
1 parent ae9a5a0 commit 6f3293e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/codemirror.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ var CodeMirror = (function() {
373373
focused = true;
374374
if (wrapper.className.search(/\bCodeMirror-focused\b/) == -1)
375375
wrapper.className += " CodeMirror-focused";
376-
prepareInput();
376+
if (!leaveInputAlone) prepareInput();
377377
}
378378
slowPoll();
379379
restartBlink();
@@ -1172,10 +1172,10 @@ var CodeMirror = (function() {
11721172
input.style.cssText = "position: fixed; width: 30px; height: 30px; top: " + (e.pageY() - 1) +
11731173
"px; left: " + (e.pageX() - 1) + "px; z-index: 1000; background: white; " +
11741174
"border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";
1175+
leaveInputAlone = true;
11751176
var val = input.value = getSelection();
11761177
focusInput();
11771178
setSelRange(input, 0, input.value.length);
1178-
leaveInputAlone = true;
11791179
function rehide() {
11801180
var newVal = splitLines(input.value).join("\n");
11811181
if (newVal != val) operation(replaceSelection)(newVal, "end");

0 commit comments

Comments
 (0)