Skip to content

Commit 1ddba34

Browse files
committed
Force stable y scroll when focusing textarea in onContextMenu
Closes #2712
1 parent 4e7e863 commit 1ddba34

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/codemirror.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3319,7 +3319,9 @@
33193319
"px; left: " + (e.clientX - 5) + "px; z-index: 1000; background: " +
33203320
(ie ? "rgba(255, 255, 255, .05)" : "transparent") +
33213321
"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";
3322+
if (webkit) var oldScrollY = window.scrollY; // Work around Chrome issue (#2712)
33223323
focusInput(cm);
3324+
if (webkit) window.scrollTo(null, oldScrollY);
33233325
resetInput(cm);
33243326
// Adds "Select all" to context menu in FF
33253327
if (!cm.somethingSelected()) display.input.value = display.prevInput = " ";

0 commit comments

Comments
 (0)