mirror of
https://github.com/langgenius/dify.git
synced 2026-05-13 08:57:28 +08:00
fix: click file missing
This commit is contained in:
parent
976fa30664
commit
ee093a21c8
@ -77,7 +77,9 @@ describe('FileReferenceBlock', () => {
|
|||||||
)
|
)
|
||||||
|
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
fireEvent.mouseDown(screen.getByText('contract.pdf'))
|
const target = screen.getByText('contract.pdf')
|
||||||
|
fireEvent.mouseDown(target)
|
||||||
|
fireEvent.click(target)
|
||||||
})
|
})
|
||||||
|
|
||||||
expect(await screen.findByText('workflow.skillEditor.referenceFiles')).toBeInTheDocument()
|
expect(await screen.findByText('workflow.skillEditor.referenceFiles')).toBeInTheDocument()
|
||||||
|
|||||||
@ -163,7 +163,21 @@ const FileReferenceBlock = ({ nodeKey, resourceId }: FileReferenceBlockProps) =>
|
|||||||
const fileBlock = (
|
const fileBlock = (
|
||||||
<Popover
|
<Popover
|
||||||
open={open}
|
open={open}
|
||||||
onOpenChange={setOpen}
|
onOpenChange={(nextOpen, eventDetails) => {
|
||||||
|
if (!nextOpen && eventDetails.reason === 'focus-out')
|
||||||
|
return
|
||||||
|
|
||||||
|
if (
|
||||||
|
!nextOpen
|
||||||
|
&& eventDetails.reason === 'outside-press'
|
||||||
|
&& eventDetails.event.target instanceof Node
|
||||||
|
&& ref.current?.contains(eventDetails.event.target)
|
||||||
|
) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
setOpen(nextOpen)
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<div ref={ref} className="inline-flex">
|
<div ref={ref} className="inline-flex">
|
||||||
<Tooltip>
|
<Tooltip>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user