mirror of
https://github.com/langgenius/dify.git
synced 2026-03-28 23:00:25 -04:00
fix: click file missing
This commit is contained in:
@@ -77,7 +77,9 @@ describe('FileReferenceBlock', () => {
|
||||
)
|
||||
|
||||
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()
|
||||
|
||||
@@ -163,7 +163,21 @@ const FileReferenceBlock = ({ nodeKey, resourceId }: FileReferenceBlockProps) =>
|
||||
const fileBlock = (
|
||||
<Popover
|
||||
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">
|
||||
<Tooltip>
|
||||
|
||||
Reference in New Issue
Block a user