The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Fix csv import dropdown overlay (#9262)
Weikoacc07f5bbd0d
diff --git a/packages/twenty-front/src/modules/spreadsheet-import/components/MatchColumnSelect.tsx b/packages/twenty-front/src/modules/spreadsheet-import/components/MatchColumnSelect.tsxindex fc58723ea39..22729baee92 100644--- a/packages/twenty-front/src/modules/spreadsheet-import/components/MatchColumnSelect.tsx+++ b/packages/twenty-front/src/modules/spreadsheet-import/components/MatchColumnSelect.tsx@@ -18,6 +18,7 @@ import { DropdownMenu } from '@/ui/layout/dropdown/components/DropdownMenu';import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';import { DropdownMenuSearchInput } from '@/ui/layout/dropdown/components/DropdownMenuSearchInput';import { DropdownMenuSeparator } from '@/ui/layout/dropdown/components/DropdownMenuSeparator';+import { OverlayContainer } from '@/ui/layout/overlay/components/OverlayContainer';import { useListenClickOutside } from '@/ui/utilities/pointer-event/hooks/useListenClickOutside';import { useUpdateEffect } from '~/hooks/useUpdateEffect';@@ -25,13 +26,6 @@ const StyledFloatingDropdown = styled.div`z-index: ${({ theme }) => theme.lastLayerZIndex};`;-const StyledDropdownMenu = styled(DropdownMenu)`- background-color: ${({ theme }) => theme.background.primary};- border: 1px solid ${({ theme }) => theme.border.color.light};- border-radius: ${({ theme }) => theme.border.radius.sm};- box-shadow: ${({ theme }) => theme.boxShadow.light};-`;-interface MatchColumnSelectProps {onChange: (value: ReadonlyDeep<SelectOption> | null) => void;value?: ReadonlyDeep<SelectOption>;@@ -128,48 +122,50 @@ export const MatchColumnSelect = ({{isOpen &&createPortal(<StyledFloatingDropdown ref={refs.setFloating} style={floatingStyles}>- <StyledDropdownMenu- data-select-disable- ref={dropdownContainerRef}- // width={refs.domReference.current?.clientWidth}- >- <DropdownMenuSearchInput- value={searchFilter}- onChange={handleFilterChange}- autoFocus- />- <DropdownMenuSeparator />- <DropdownMenuItemsContainer hasMaxHeight>- {options?.map((option) => (- <React.Fragment key={option.label}>- <MenuItemSelect- selected={value?.label === option.label}- onClick={() => handleChange(option)}- disabled={- option.disabled && value?.value !== option.value- }- LeftIcon={option?.icon}- text={option.label}- />- {option.disabled &&- value?.value !== option.value &&- createPortal(- <AppTooltip- key={option.value}- anchorSelect={`#${option.value}`}- content="You are already importing this column."- place="right"- offset={-20}- />,- document.body,- )}- </React.Fragment>- ))}- {options?.length === 0 && (- <MenuItem key="No result" text="No result" />- )}- </DropdownMenuItemsContainer>- </StyledDropdownMenu>+ <OverlayContainer>+ <DropdownMenu+ data-select-disable+ ref={dropdownContainerRef}+ // width={refs.domReference.current?.clientWidth}+ >+ <DropdownMenuSearchInput+ value={searchFilter}+ onChange={handleFilterChange}+ autoFocus+ />+ <DropdownMenuSeparator />+ <DropdownMenuItemsContainer hasMaxHeight>+ {options?.map((option) => (+ <React.Fragment key={option.label}>+ <MenuItemSelect+ selected={value?.label === option.label}+ onClick={() => handleChange(option)}+ disabled={+ option.disabled && value?.value !== option.value+ }+ LeftIcon={option?.icon}+ text={option.label}+ />+ {option.disabled &&+ value?.value !== option.value &&+ createPortal(+ <AppTooltip+ key={option.value}+ anchorSelect={`#${option.value}`}+ content="You are already importing this column."+ place="right"+ offset={-20}+ />,+ document.body,+ )}+ </React.Fragment>+ ))}+ {options?.length === 0 && (+ <MenuItem key="No result" text="No result" />+ )}+ </DropdownMenuItemsContainer>+ </DropdownMenu>+ </OverlayContainer></StyledFloatingDropdown>,document.body,)}