fix glitch for relation picker search (#8040)

Fix for #7957

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
This commit is contained in:
Sanskar Jain
2024-10-25 20:21:52 +05:30
committed by GitHub
parent f633f0d330
commit 9c923ba8d5
13 changed files with 162 additions and 92 deletions
@@ -3,7 +3,6 @@ import styled from '@emotion/styled';
import { ScrollWrapper } from '@/ui/utilities/scroll/components/ScrollWrapper';
const StyledDropdownMenuItemsExternalContainer = styled.div<{
hasMinHeight?: boolean;
hasMaxHeight?: boolean;
}>`
--padding: ${({ theme }) => theme.spacing(1)};
@@ -13,7 +12,6 @@ const StyledDropdownMenuItemsExternalContainer = styled.div<{
flex-direction: column;
gap: 2px;
min-height: ${({ hasMinHeight }) => (hasMinHeight ? '150px' : '100%')};
max-height: ${({ hasMaxHeight }) => (hasMaxHeight ? '188px' : 'none')};
overflow-y: auto;
@@ -38,18 +36,13 @@ const StyledDropdownMenuItemsInternalContainer = styled.div`
export const DropdownMenuItemsContainer = ({
children,
hasMinHeight,
hasMaxHeight,
}: {
children: React.ReactNode;
hasMinHeight?: boolean;
hasMaxHeight?: boolean;
}) => {
return (
<StyledDropdownMenuItemsExternalContainer
hasMaxHeight={hasMaxHeight}
hasMinHeight={hasMinHeight}
>
<StyledDropdownMenuItemsExternalContainer hasMaxHeight={hasMaxHeight}>
{hasMaxHeight ? (
<StyledScrollWrapper contextProviderName="dropdownMenuItemsContainer">
<StyledDropdownMenuItemsInternalContainer>