Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix(web): simplify completed drawer dismissal (#37664)

yyh8c484411ea97
diff --git a/web/app/components/datasets/documents/detail/completed/common/drawer.tsx b/web/app/components/datasets/documents/detail/completed/common/drawer.tsx
index 86c40a73677..dac3cef9f2d 100644
--- a/web/app/components/datasets/documents/detail/completed/common/drawer.tsx
+++ b/web/app/components/datasets/documents/detail/completed/common/drawer.tsx
@@ -1,4 +1,4 @@
-import type { ComponentProps, ReactNode } from 'react'
+import type { ReactNode } from 'react'
import { cn } from '@langgenius/dify-ui/cn'
import {
Drawer,
@@ -11,7 +11,6 @@ import {
type DrawerSide = 'right' | 'left' | 'bottom' | 'top'
type DrawerSwipeDirection = 'right' | 'left' | 'down' | 'up'
-type DrawerOpenChange = NonNullable<ComponentProps<typeof Drawer>['onOpenChange']>
type CompletedDrawerProps = {
open: boolean
@@ -47,16 +46,6 @@ export function CompletedDrawer({
panelContentClassName,
modal = false,
}: CompletedDrawerProps) {
- const handleOpenChange: DrawerOpenChange = (nextOpen, eventDetails) => {
- if (nextOpen)
- return
-
- if (eventDetails.reason === 'focus-out' || eventDetails.reason === 'outside-press')
- return
-
- onClose()
- }
-
if (!open)
return null
@@ -66,7 +55,7 @@ export function CompletedDrawer({
modal={modal}
swipeDirection={SIDE_TO_SWIPE_DIRECTION[side]}
disablePointerDismissal
- onOpenChange={handleOpenChange}
+ onOpenChange={nextOpen => !nextOpen && onClose()}
>
<DrawerPortal>
{modal && (