mirror of https://github.com/langgenius/dify.git
fix: not choose vars
This commit is contained in:
parent
5156b8f9c9
commit
40591b2196
|
|
@ -258,8 +258,8 @@ export default function ShortcutsPopupPlugin({
|
|||
if (!portalRef.current.contains(e.target as Node))
|
||||
closePortal()
|
||||
}
|
||||
document.addEventListener('mousedown', onMouseDown, true)
|
||||
return () => document.removeEventListener('mousedown', onMouseDown, true)
|
||||
document.addEventListener('mousedown', onMouseDown, false)
|
||||
return () => document.removeEventListener('mousedown', onMouseDown, false)
|
||||
}, [open, closePortal])
|
||||
|
||||
const handleInsert = useCallback((command: LexicalCommand<unknown>, params: any) => {
|
||||
|
|
|
|||
|
|
@ -150,6 +150,7 @@ const Item: FC<ItemProps> = ({
|
|||
}, [isHovering])
|
||||
const handleChosen = (e: React.MouseEvent) => {
|
||||
e.stopPropagation()
|
||||
e.nativeEvent.stopImmediatePropagation()
|
||||
if (!isSupportFileVar && isFile)
|
||||
return
|
||||
|
||||
|
|
@ -186,7 +187,10 @@ const Item: FC<ItemProps> = ({
|
|||
)
|
||||
}
|
||||
onClick={handleChosen}
|
||||
onMouseDown={e => e.preventDefault()}
|
||||
onMouseDown={(e) => {
|
||||
e.stopPropagation()
|
||||
e.nativeEvent.stopImmediatePropagation()
|
||||
}}
|
||||
>
|
||||
<div className='flex w-0 grow items-center'>
|
||||
{!isFlat && <VariableIconWithColor
|
||||
|
|
|
|||
Loading…
Reference in New Issue