mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Treat a contextmenu event as a mouseup event (#14754)
GitOrigin-RevId: 8f4f3cf53ccf09fd5e4c4a504d40cc375aa12b6c
This commit is contained in:
parent
13bbea4ced
commit
84a697de4f
1 changed files with 8 additions and 0 deletions
|
@ -99,6 +99,14 @@ const mouseDownListener = EditorView.domEventHandlers({
|
|||
})
|
||||
})
|
||||
},
|
||||
contextmenu: (event: MouseEvent, view) => {
|
||||
// treat a `contextmenu` event as a `mouseup` event, which isn't fired
|
||||
window.setTimeout(() => {
|
||||
view.dispatch({
|
||||
effects: mouseDownEffect.of(false),
|
||||
})
|
||||
})
|
||||
},
|
||||
})
|
||||
|
||||
const mousedownSelectionState = StateField.define<EditorSelection | undefined>({
|
||||
|
|
Loading…
Reference in a new issue