feat(interaction): add zoomOnScroll property closes #331

This commit is contained in:
moklick
2020-07-14 13:28:59 +02:00
parent 0593db289a
commit 65764fbefb
5 changed files with 29 additions and 3 deletions
+14
View File
@@ -18,6 +18,7 @@ const InteractionFlow = () => {
const [isSelectable, setIsSelectable] = useState(false);
const [isDraggable, setIsDraggable] = useState(false);
const [isConnectable, setIsConnectable] = useState(false);
const [zoomOnScroll, setZoomOnScroll] = useState(true);
return (
<ReactFlow
@@ -25,6 +26,7 @@ const InteractionFlow = () => {
elementsSelectable={isSelectable}
nodesConnectable={isConnectable}
nodesDraggable={isDraggable}
zoomOnScroll={zoomOnScroll}
onConnect={onConnect}
>
<MiniMap />
@@ -67,6 +69,18 @@ const InteractionFlow = () => {
/>
</label>
</div>
<div>
<label htmlFor="zoomonscroll">
zoom on scroll
<input
id="zoomonscroll"
type="checkbox"
checked={zoomOnScroll}
onChange={(evt) => setZoomOnScroll(evt.target.checked)}
className="react-flow__zoomonscroll"
/>
</label>
</div>
</div>
</ReactFlow>
);