fix(core): don't set user selection flags on pointer down (#1600)
* chore(core): remove deprecation of `removeSelectedElements` Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> * fix(core): don't set user selection flags on pointer down Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> * fix(core): prevent panning on drag when selection is active Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> * chore(changeset): add 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:
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@vue-flow/core": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Don't set user selection flags on pointer down, only setting them when pointer is moved to allow pane click events to occur when `selectionKeyCode` is `true` (i.e. selection on drag).
|
||||||
@@ -150,9 +150,6 @@ function onPointerDown(event: PointerEvent) {
|
|||||||
y,
|
y,
|
||||||
}
|
}
|
||||||
|
|
||||||
userSelectionActive.value = true
|
|
||||||
nodesSelectionActive.value = false
|
|
||||||
|
|
||||||
emits.selectionStart(event)
|
emits.selectionStart(event)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ const selectionKeyPressed = useKeyPress(selectionKeyCode)
|
|||||||
|
|
||||||
const zoomKeyPressed = useKeyPress(zoomActivationKeyCode)
|
const zoomKeyPressed = useKeyPress(zoomActivationKeyCode)
|
||||||
|
|
||||||
const shouldPanOnDrag = toRef(() => panKeyPressed.value || panOnDrag.value)
|
const shouldPanOnDrag = toRef(() => !selectionKeyPressed.value && (panKeyPressed.value || panOnDrag.value))
|
||||||
|
|
||||||
const shouldPanOnScroll = toRef(() => panKeyPressed.value || panOnScroll.value)
|
const shouldPanOnScroll = toRef(() => panKeyPressed.value || panOnScroll.value)
|
||||||
|
|
||||||
|
|||||||
@@ -279,10 +279,7 @@ export interface Actions extends Omit<ViewportHelper, 'viewportInitialized'> {
|
|||||||
removeSelectedEdges: (edges: GraphEdge[]) => void
|
removeSelectedEdges: (edges: GraphEdge[]) => void
|
||||||
/** manually unselect nodes and remove from state */
|
/** manually unselect nodes and remove from state */
|
||||||
removeSelectedNodes: (nodes: GraphNode[]) => void
|
removeSelectedNodes: (nodes: GraphNode[]) => void
|
||||||
/**
|
/** unselect selected elements (if none are passed, all elements are unselected) */
|
||||||
* @deprecated will be replaced in the next major
|
|
||||||
* unselect selected elements (if none are passed, all elements are unselected)
|
|
||||||
*/
|
|
||||||
removeSelectedElements: (elements?: Elements) => void
|
removeSelectedElements: (elements?: Elements) => void
|
||||||
/** apply min zoom value to d3 */
|
/** apply min zoom value to d3 */
|
||||||
setMinZoom: (zoom: number) => void
|
setMinZoom: (zoom: number) => void
|
||||||
|
|||||||
Reference in New Issue
Block a user