Skip to content

Commit

Permalink
fix: chunk preview drawer can not scroll, common drawer content scrol…
Browse files Browse the repository at this point in the history
…l should decide by content; (#1539)
  • Loading branch information
maquannene authored May 22, 2024
1 parent a14a8ae commit 87e4afe
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 23 deletions.
2 changes: 1 addition & 1 deletion packages/web/components/common/MyDrawer/MyRightDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const MyRightDrawer = ({
<DrawerCloseButton position={'relative'} fontSize={'sm'} top={0} right={0} />
</Flex>

<DrawerBody overflow={'unset'} px={props?.px}>
<DrawerBody overflow={'hidden'} px={props?.px}>
{children}
<Loading loading={isLoading} fixed={false} />
</DrawerBody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export const useDebug = () => {
maxW={['90vw', '35vw']}
px={0}
>
<Flex flexDirection={'column'} h={'100%'}>
<Flex flexDirection={'column'} h={'100%'} overflowY={'auto'}>
<Box flex={'1 0 0'} overflow={'auto'} px={6}>
{renderInputs.map((input) => {
const required = input.required || false;
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -83,26 +83,28 @@ const PreviewChunks = ({
isLoading={isLoading}
maxW={['90vw', '40vw']}
>
{data.map((item, index) => (
<Box
key={index}
whiteSpace={'pre-wrap'}
fontSize={'sm'}
p={4}
bg={index % 2 === 0 ? 'white' : 'myWhite.600'}
mb={3}
borderRadius={'md'}
borderWidth={'1px'}
borderColor={'borderColor.low'}
boxShadow={'2'}
_notLast={{
mb: 2
}}
>
<Box color={'myGray.900'}>{item.q}</Box>
<Box color={'myGray.500'}>{item.a}</Box>
</Box>
))}
<Flex flexDirection={'column'} height={'100%'} overflowY={'auto'}>
{data.map((item, index) => (
<Box
key={index}
whiteSpace={'pre-wrap'}
fontSize={'sm'}
p={4}
bg={index % 2 === 0 ? 'white' : 'myWhite.600'}
mb={3}
borderRadius={'md'}
borderWidth={'1px'}
borderColor={'borderColor.low'}
boxShadow={'2'}
_notLast={{
mb: 2
}}
>
<Box color={'myGray.900'}>{item.q}</Box>
<Box color={'myGray.500'}>{item.a}</Box>
</Box>
))}
</Flex>
</MyRightDrawer>
);
};
Expand Down

0 comments on commit 87e4afe

Please sign in to comment.