fix(core): allow control key as pan activation key code (#1707)

* fix(core): allow control key as pan activation key code

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>

* chore(changeset): add

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>

* fix(core): allow drag regardless of btn chosen

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>

* fix(core): prevent browser ctx menu on pane right click

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>

* chore(core): cleanup useKeyPress handler

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>

* fix(core): check `panOnDrag` prop for allowed drag buttons

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>

* chore(changeset): add

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>

* chore(core): cleanup

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>

---------

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2024-12-07 16:39:07 +01:00
parent 7a022c89c6
commit f4f2494fd1
6 changed files with 26 additions and 17 deletions
+2 -5
View File
@@ -17,7 +17,6 @@ const {
emits,
userSelectionActive,
removeSelectedElements,
panOnDrag,
userSelectionRect,
elementsSelectable,
nodesSelectionActive,
@@ -101,10 +100,8 @@ function onClick(event: MouseEvent) {
}
function onContextMenu(event: MouseEvent) {
if (Array.isArray(panOnDrag.value) && panOnDrag.value?.includes(2)) {
event.preventDefault()
return
}
event.preventDefault()
event.stopPropagation()
emits.paneContextMenu(event)
}