fix: node shortcuts active in input fields (#3438)

This commit is contained in:
Pascal M
2024-04-13 03:48:39 +02:00
committed by GitHub
parent 6021ca5c31
commit a355225a83
4 changed files with 39 additions and 2 deletions

View File

@@ -331,6 +331,16 @@ export const useWorkflow = () => {
return nodes.find(node => node.id === nodeId) || nodes.find(node => node.data.type === BlockEnum.Start)
}, [store])
const enableShortcuts = useCallback(() => {
const { setShortcutsDisabled } = workflowStore.getState()
setShortcutsDisabled(false)
}, [workflowStore])
const disableShortcuts = useCallback(() => {
const { setShortcutsDisabled } = workflowStore.getState()
setShortcutsDisabled(true)
}, [workflowStore])
return {
handleLayout,
getTreeLeafNodes,
@@ -345,6 +355,8 @@ export const useWorkflow = () => {
renderTreeFromRecord,
getNode,
getBeforeNodeById,
enableShortcuts,
disableShortcuts,
}
}