The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
fix: dropdown max-height and padding bottom (#8167)
Harsh Singhc0484aa9a291
diff --git a/packages/twenty-front/src/modules/ui/layout/dropdown/components/Dropdown.tsx b/packages/twenty-front/src/modules/ui/layout/dropdown/components/Dropdown.tsxindex c4d62a56002..ce7c7dbb456 100644--- a/packages/twenty-front/src/modules/ui/layout/dropdown/components/Dropdown.tsx+++ b/packages/twenty-front/src/modules/ui/layout/dropdown/components/Dropdown.tsx@@ -4,6 +4,7 @@ import {FloatingPortal,offset,Placement,+ size,useFloating,} from '@floating-ui/react';import { MouseEvent, useEffect, useRef } from 'react';@@ -85,7 +86,19 @@ export const Dropdown = ({const { refs, floatingStyles, placement } = useFloating({placement: dropdownPlacement,- middleware: [flip(), ...offsetMiddlewares],+ middleware: [+ flip(),+ size({+ padding: 12 + 20, // 12px for padding bottom, 20px for dropdown bottom margin target+ apply: ({ availableHeight, elements }) => {+ elements.floating.style.maxHeight =+ availableHeight >= elements.floating.scrollHeight+ ? ''+ : `${availableHeight}px`;+ },+ }),+ ...offsetMiddlewares,+ ],whileElementsMounted: autoUpdate,strategy: dropdownStrategy,});diff --git a/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenu.tsx b/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenu.tsxindex 5ac402f98e8..8111b291b22 100644--- a/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenu.tsx+++ b/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenu.tsx@@ -25,6 +25,8 @@ const StyledDropdownMenu = styled.div<{flex-direction: column;z-index: 30;+ overflow-y: auto;+ overflow-x: hidden;width: ${({ width = 160 }) =>typeof width === 'number' ? `${width}px` : width};`;