Skip to content

Commit

Permalink
Make sure contextmenu event is also forwarded when fired on the input…
Browse files Browse the repository at this point in the history
… field

Since Firefox, as of patch a21ea6f, seems to fire it on the
textarea.

Closes #6116
  • Loading branch information
marijnh committed Jan 17, 2020
1 parent a173882 commit f41c636
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/edit/CodeMirror.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ function registerEventHandlers(cm) {
// which point we can't mess with it anymore. Context menu is
// handled in onMouseDown for these browsers.
on(d.scroller, "contextmenu", e => onContextMenu(cm, e))
on(d.input.getField(), "contextmenu", e => {
if (!d.scroller.contains(e.target)) onContextMenu(cm, e)
})

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

0 comments on commit f41c636

Please sign in to comment.