From 7e33f9fb824bffccd02a7582f15e21de563b75e4 Mon Sep 17 00:00:00 2001 From: maquannene Date: Mon, 20 May 2024 15:04:26 +0800 Subject: [PATCH] fix: chunk preview drawer can not scroll, common drawer content scroll should decide by content; --- .../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 9f6130ac5f0..f1d0d14cc8a 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 276a45d4d9a..c3e3e029464 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 bacbb323bcd..2622c542292 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} + + ))} + ); };