#Controls lock button initial state

1 messages · Page 1 of 1 (latest)

grand adder
#

Hello!
Is there any solution to control the initial state of lock button in the Controls ?

Thanks!

ocean thistle
#

Alas, not by passing a prop to the Controls afaik
The state of this button is defined by s.nodesDraggable || s.nodesConnectable || s.elementsSelectable,

So if either of these are true the button will be shown as unlocked (interactive)

All of these can be passed as props to <ReactFlow> though so you can basically set the locked state by doing this

<ReactFlow nodesDraggable={false} nodesConnectable={false} elementsSelectable={false} ...>
  <Controls ...>
grand adder
#

Thanks !