Skip to content

Commit 87e4afe

Browse files
authored
fix: chunk preview drawer can not scroll, common drawer content scroll should decide by content; (FlowiseAI#1539)
1 parent a14a8ae commit 87e4afe

File tree

3 files changed

+25
-23
lines changed

3 files changed

+25
-23
lines changed

packages/web/components/common/MyDrawer/MyRightDrawer.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const MyRightDrawer = ({
6767
<DrawerCloseButton position={'relative'} fontSize={'sm'} top={0} right={0} />
6868
</Flex>
6969

70-
<DrawerBody overflow={'unset'} px={props?.px}>
70+
<DrawerBody overflow={'hidden'} px={props?.px}>
7171
{children}
7272
<Loading loading={isLoading} fixed={false} />
7373
</DrawerBody>

projects/app/src/components/core/workflow/Flow/hooks/useDebug.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export const useDebug = () => {
165165
maxW={['90vw', '35vw']}
166166
px={0}
167167
>
168-
<Flex flexDirection={'column'} h={'100%'}>
168+
<Flex flexDirection={'column'} h={'100%'} overflowY={'auto'}>
169169
<Box flex={'1 0 0'} overflow={'auto'} px={6}>
170170
{renderInputs.map((input) => {
171171
const required = input.required || false;

projects/app/src/pages/dataset/detail/components/Import/components/PreviewChunks.tsx

+23-21
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useMemo } from 'react';
2-
import { Box } from '@chakra-ui/react';
2+
import { Box, Flex } from '@chakra-ui/react';
33
import { ImportSourceItemType } from '@/web/core/dataset/type';
44
import { useQuery } from '@tanstack/react-query';
55
import MyRightDrawer from '@fastgpt/web/components/common/MyDrawer/MyRightDrawer';
@@ -83,26 +83,28 @@ const PreviewChunks = ({
8383
isLoading={isLoading}
8484
maxW={['90vw', '40vw']}
8585
>
86-
{data.map((item, index) => (
87-
<Box
88-
key={index}
89-
whiteSpace={'pre-wrap'}
90-
fontSize={'sm'}
91-
p={4}
92-
bg={index % 2 === 0 ? 'white' : 'myWhite.600'}
93-
mb={3}
94-
borderRadius={'md'}
95-
borderWidth={'1px'}
96-
borderColor={'borderColor.low'}
97-
boxShadow={'2'}
98-
_notLast={{
99-
mb: 2
100-
}}
101-
>
102-
<Box color={'myGray.900'}>{item.q}</Box>
103-
<Box color={'myGray.500'}>{item.a}</Box>
104-
</Box>
105-
))}
86+
<Flex flexDirection={'column'} height={'100%'} overflowY={'auto'}>
87+
{data.map((item, index) => (
88+
<Box
89+
key={index}
90+
whiteSpace={'pre-wrap'}
91+
fontSize={'sm'}
92+
p={4}
93+
bg={index % 2 === 0 ? 'white' : 'myWhite.600'}
94+
mb={3}
95+
borderRadius={'md'}
96+
borderWidth={'1px'}
97+
borderColor={'borderColor.low'}
98+
boxShadow={'2'}
99+
_notLast={{
100+
mb: 2
101+
}}
102+
>
103+
<Box color={'myGray.900'}>{item.q}</Box>
104+
<Box color={'myGray.500'}>{item.a}</Box>
105+
</Box>
106+
))}
107+
</Flex>
106108
</MyRightDrawer>
107109
);
108110
};

0 commit comments

Comments
 (0)