Merge pull request #3594 from xyflow/fix/pan-activation-key
Fix/pan activation key
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
# Changesets
|
||||
|
||||
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
|
||||
with multi-package repos, or single-package repos to help you version and publish your code. You can
|
||||
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
|
||||
|
||||
We have a quick list of common questions to get you started engaging with this project in
|
||||
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"$schema": "https://unpkg.com/@changesets/config@2.1.1/schema.json",
|
||||
"changelog": ["@changesets/changelog-github", { "repo": "wbkd/react-flow" }],
|
||||
"commit": false,
|
||||
"fixed": [],
|
||||
"linked": [],
|
||||
"access": "public",
|
||||
"baseBranch": "main",
|
||||
"updateInternalDependencies": "patch",
|
||||
"ignore": []
|
||||
}
|
||||
@@ -50,7 +50,7 @@ const FlowRenderer = ({
|
||||
elementsSelectable,
|
||||
zoomOnScroll,
|
||||
zoomOnPinch,
|
||||
panOnScroll,
|
||||
panOnScroll: _panOnScroll,
|
||||
panOnScrollSpeed,
|
||||
panOnScrollMode,
|
||||
zoomOnDoubleClick,
|
||||
@@ -72,6 +72,7 @@ const FlowRenderer = ({
|
||||
const panActivationKeyPressed = useKeyPress(panActivationKeyCode);
|
||||
|
||||
const panOnDrag = panActivationKeyPressed || _panOnDrag;
|
||||
const panOnScroll = panActivationKeyPressed || _panOnScroll;
|
||||
const isSelecting = selectionKeyPressed || (selectionOnDrag && panOnDrag !== true);
|
||||
|
||||
useGlobalKeyHandler({ deleteKeyCode, multiSelectionKeyCode });
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
|
||||
$: viewPort = initialViewport || { x: 0, y: 0, zoom: 1 };
|
||||
$: _panOnDrag = $panActivationKeyPressed || panOnDrag;
|
||||
$: _panOnScroll = $panActivationKeyPressed || panOnScroll;
|
||||
</script>
|
||||
|
||||
<div
|
||||
@@ -50,7 +51,7 @@
|
||||
zoomOnScroll,
|
||||
zoomOnDoubleClick,
|
||||
zoomOnPinch,
|
||||
panOnScroll,
|
||||
panOnScroll: _panOnScroll,
|
||||
panOnDrag: _panOnDrag,
|
||||
panOnScrollSpeed: 0.5,
|
||||
panOnScrollMode: panOnScrollMode || PanOnScrollMode.Free,
|
||||
|
||||
Reference in New Issue
Block a user