feat(interaction): add zoomOnDoublickClick and fix behaviour closes #338
This commit is contained in:
@@ -23,6 +23,7 @@ const InteractionFlow = () => {
|
||||
const [isDraggable, setIsDraggable] = useState(false);
|
||||
const [isConnectable, setIsConnectable] = useState(false);
|
||||
const [zoomOnScroll, setZoomOnScroll] = useState(true);
|
||||
const [zoomOnDoubleClick, setZoomOnDoubleClick] = useState(true);
|
||||
|
||||
return (
|
||||
<ReactFlow
|
||||
@@ -31,6 +32,7 @@ const InteractionFlow = () => {
|
||||
nodesConnectable={isConnectable}
|
||||
nodesDraggable={isDraggable}
|
||||
zoomOnScroll={zoomOnScroll}
|
||||
zoomOnDoubleClick={zoomOnDoubleClick}
|
||||
onConnect={onConnect}
|
||||
onElementClick={onElementClick}
|
||||
onNodeDragStart={onNodeDragStart}
|
||||
@@ -88,6 +90,18 @@ const InteractionFlow = () => {
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label htmlFor="zoomondbl">
|
||||
zoom on double click
|
||||
<input
|
||||
id="zoomondbl"
|
||||
type="checkbox"
|
||||
checked={zoomOnDoubleClick}
|
||||
onChange={(evt) => setZoomOnDoubleClick(evt.target.checked)}
|
||||
className="react-flow__zoomondbl"
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</ReactFlow>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user