mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 11:42:29 +08:00
fix: stop event propagation when deleting selected workflow var node (#4158)
This commit is contained in:
parent
2fdd64c1b5
commit
97dcb8977a
|
@ -64,6 +64,7 @@ export const useSelectOrDelete: UseSelectOrDeleteHanlder = (nodeKey: string, com
|
||||||
editor.dispatchCommand(command, undefined)
|
editor.dispatchCommand(command, undefined)
|
||||||
|
|
||||||
node.remove()
|
node.remove()
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ import {
|
||||||
} from 'lexical'
|
} from 'lexical'
|
||||||
import { mergeRegister } from '@lexical/utils'
|
import { mergeRegister } from '@lexical/utils'
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'
|
||||||
|
import cn from 'classnames'
|
||||||
import { useSelectOrDelete } from '../../hooks'
|
import { useSelectOrDelete } from '../../hooks'
|
||||||
import type { WorkflowNodesMap } from './node'
|
import type { WorkflowNodesMap } from './node'
|
||||||
import { WorkflowVariableBlockNode } from './node'
|
import { WorkflowVariableBlockNode } from './node'
|
||||||
|
@ -61,11 +62,11 @@ const WorkflowVariableBlockComponent = ({
|
||||||
|
|
||||||
const Item = (
|
const Item = (
|
||||||
<div
|
<div
|
||||||
className={`
|
className={cn(
|
||||||
mx-0.5 relative group/wrap flex items-center h-[18px] pl-0.5 pr-[3px] rounded-[5px] border
|
'mx-0.5 relative group/wrap flex items-center h-[18px] pl-0.5 pr-[3px] rounded-[5px] border select-none',
|
||||||
${isSelected ? ' border-[#84ADFF] bg-[#F5F8FF]' : ' border-black/5 bg-white'}
|
isSelected ? ' border-[#84ADFF] bg-[#F5F8FF]' : ' border-black/5 bg-white',
|
||||||
${!node && '!border-[#F04438] !bg-[#FEF3F2]'}
|
!node && '!border-[#F04438] !bg-[#FEF3F2]',
|
||||||
`}
|
)}
|
||||||
ref={ref}
|
ref={ref}
|
||||||
>
|
>
|
||||||
<div className='flex items-center'>
|
<div className='flex items-center'>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user