fix: two scrollbar

This commit is contained in:
Joel 2024-09-10 15:05:54 +08:00
parent a689cd6fd4
commit ea40b1dcb2
2 changed files with 5 additions and 3 deletions

View File

@ -133,11 +133,10 @@ const ComponentPicker = ({
// See https://github.com/facebook/lexical/blob/ac97dfa9e14a73ea2d6934ff566282d7f758e8bb/packages/lexical-react/src/shared/LexicalMenu.ts#L493
<div className='w-0 h-0'>
<div
className='p-1 w-[260px] bg-white rounded-lg border-[0.5px] border-gray-200 shadow-lg overflow-y-auto overflow-x-hidden'
className='p-1 w-[260px] bg-white rounded-lg border-[0.5px] border-gray-200 shadow-lg'
style={{
...floatingStyles,
visibility: isPositioned ? 'visible' : 'hidden',
maxHeight: 'calc(1 / 3 * 100vh)',
}}
ref={refs.setFloating}
>
@ -178,6 +177,7 @@ const ComponentPicker = ({
onChange={(variables: string[]) => {
handleSelectWorkflowVariable(variables)
}}
maxHeightClass='max-h-[34vh]'
/>
</div>
</>

View File

@ -219,6 +219,7 @@ type Props = {
vars: NodeOutPutVar[]
onChange: (value: ValueSelector, item: Var) => void
itemWidth?: number
maxHeightClass?: string
}
const VarReferenceVars: FC<Props> = ({
hideSearch,
@ -226,6 +227,7 @@ const VarReferenceVars: FC<Props> = ({
vars,
onChange,
itemWidth,
maxHeightClass,
}) => {
const { t } = useTranslation()
const [searchText, setSearchText] = useState('')
@ -279,7 +281,7 @@ const VarReferenceVars: FC<Props> = ({
}
{filteredVars.length > 0
? <div className='max-h-[85vh] overflow-y-auto'>
? <div className={cn('max-h-[85vh] overflow-y-auto', maxHeightClass)}>
{
filteredVars.map((item, i) => (