From 87e4afe89bbca55f6436907db5c36dded1bcf94d Mon Sep 17 00:00:00 2001 From: Cheer Date: Wed, 22 May 2024 10:18:21 +0800 Subject: [PATCH] fix: chunk preview drawer can not scroll, common drawer content scroll should decide by content; (#1539) --- .../common/MyDrawer/MyRightDrawer.tsx | 2 +- .../core/workflow/Flow/hooks/useDebug.tsx | 2 +- .../Import/components/PreviewChunks.tsx | 44 ++++++++++--------- 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/packages/web/components/common/MyDrawer/MyRightDrawer.tsx b/packages/web/components/common/MyDrawer/MyRightDrawer.tsx index 9f6130ac5..f1d0d14cc 100644 --- a/packages/web/components/common/MyDrawer/MyRightDrawer.tsx +++ b/packages/web/components/common/MyDrawer/MyRightDrawer.tsx @@ -67,7 +67,7 @@ const MyRightDrawer = ({ - + {children} diff --git a/projects/app/src/components/core/workflow/Flow/hooks/useDebug.tsx b/projects/app/src/components/core/workflow/Flow/hooks/useDebug.tsx index bc1852e98..64a27eb36 100644 --- a/projects/app/src/components/core/workflow/Flow/hooks/useDebug.tsx +++ b/projects/app/src/components/core/workflow/Flow/hooks/useDebug.tsx @@ -165,7 +165,7 @@ export const useDebug = () => { maxW={['90vw', '35vw']} px={0} > - + {renderInputs.map((input) => { const required = input.required || false; diff --git a/projects/app/src/pages/dataset/detail/components/Import/components/PreviewChunks.tsx b/projects/app/src/pages/dataset/detail/components/Import/components/PreviewChunks.tsx index bacbb323b..2622c5422 100644 --- a/projects/app/src/pages/dataset/detail/components/Import/components/PreviewChunks.tsx +++ b/projects/app/src/pages/dataset/detail/components/Import/components/PreviewChunks.tsx @@ -1,5 +1,5 @@ import React, { useMemo } from 'react'; -import { Box } from '@chakra-ui/react'; +import { Box, Flex } from '@chakra-ui/react'; import { ImportSourceItemType } from '@/web/core/dataset/type'; import { useQuery } from '@tanstack/react-query'; import MyRightDrawer from '@fastgpt/web/components/common/MyDrawer/MyRightDrawer'; @@ -83,26 +83,28 @@ const PreviewChunks = ({ isLoading={isLoading} maxW={['90vw', '40vw']} > - {data.map((item, index) => ( - - {item.q} - {item.a} - - ))} + + {data.map((item, index) => ( + + {item.q} + {item.a} + + ))} + ); };