Skip to content

Commit 9dd0554

Browse files
committed
Another approach to fixing the context menu in FF
1 parent 0b63064 commit 9dd0554

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

lib/codemirror.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,15 +1135,25 @@ var CodeMirror = (function() {
11351135
var val = input.value = getSelection();
11361136
focusInput();
11371137
setSelRange(input, 0, input.value.length);
1138-
if (gecko) e.stop();
11391138
leaveInputAlone = true;
1140-
setTimeout(function() {
1139+
function rehide() {
11411140
if (input.value != val) operation(replaceSelection)(input.value, "end");
11421141
input.style.cssText = oldCSS;
11431142
leaveInputAlone = false;
11441143
prepareInput();
11451144
slowPoll();
1146-
}, 100);
1145+
}
1146+
1147+
if (gecko) {
1148+
e.stop()
1149+
var mouseup = connect(window, "mouseup", function() {
1150+
mouseup();
1151+
setTimeout(rehide, 20);
1152+
}, true);
1153+
}
1154+
else {
1155+
setTimeout(rehide, 50);
1156+
}
11471157
}
11481158

11491159
// Cursor-blinking

0 commit comments

Comments
 (0)