#Changing State of Lock Button in Code

1 messages · Page 1 of 1 (latest)

dense coral
#

Is there any way to set the Controls panel lock button state in code? I could not find anything in the documentation. My issue is that I have an event linked to it via onInteractiveChange which toggles a true/false interaction separately my issue comes from the fact that the user can close the flow and reopen it which results in the lock state resetting, but my state stays the same (how I intend it to work). Is there a way to set the lock's value?

brisk sorrel
#

the lock is open when

#

nodesDraggable || nodesConnectable || elementsSelectable,

#

you can check the status by using the useStore hook

#

const isInteractive = useStore(s => s.nodesDraggable || s.nodesConnectable || s.elementsSelectable)