Skip to content

Commit f41c636

Browse files
committed
Make sure contextmenu event is also forwarded when fired on the input field
Since Firefox, as of patch a21ea6f, seems to fire it on the textarea. Closes #6116
1 parent a173882 commit f41c636

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/edit/CodeMirror.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ function registerEventHandlers(cm) {
120120
// which point we can't mess with it anymore. Context menu is
121121
// handled in onMouseDown for these browsers.
122122
on(d.scroller, "contextmenu", e => onContextMenu(cm, e))
123+
on(d.input.getField(), "contextmenu", e => {
124+
if (!d.scroller.contains(e.target)) onContextMenu(cm, e)
125+
})
123126

124127
// Used to suppress mouse event handling when a touch happens
125128
let touchFinished, prevTouch = {end: 0}

0 commit comments

Comments
 (0)