Skip to content
This repository has been archived by the owner on Nov 7, 2022. It is now read-only.

Commit

Permalink
fix(legacy-editor): only trigger multiple node selection by left-clic…
Browse files Browse the repository at this point in the history
…k mousedown (#444)

fix(legacy-editor): only trigger multiple selection by left-click mousedown

fix #250
  • Loading branch information
Darmody authored Jul 21, 2022
1 parent b0e22b2 commit 93e11de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ describe('DomEvents', () => {
const domEvents = new MultipleNodeSelectionDomEvents(editor, {})

const event: Partial<MouseEvent> = {
button: 0,
clientX: x,
clientY: y
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ export class MultipleNodeSelectionDomEvents {
}

public mousedown(view: EditorView, event: MouseEvent): boolean {
// 0 represent for left-click, only accept left-lick case.
if (event.button !== 0) return false

this.container.mouseSelection = {
...this.container.mouseSelection,
anchor: {
Expand Down

0 comments on commit 93e11de

Please sign in to comment.