diff --git a/apps/designer/app/designer/features/props-panel/props-panel.tsx b/apps/designer/app/designer/features/props-panel/props-panel.tsx index 028de17c6d..05f352143e 100644 --- a/apps/designer/app/designer/features/props-panel/props-panel.tsx +++ b/apps/designer/app/designer/features/props-panel/props-panel.tsx @@ -82,12 +82,6 @@ const Property = ({ )} - popperProps={{ - align: "start", - sideOffset: 5, - }} - // @todo should we use the side panel (width - x) or something? - listCss={{ width: 230 }} /> {isInvalidProp ? ( diff --git a/apps/designer/app/shared/design-system/components/combobox.tsx b/apps/designer/app/shared/design-system/components/combobox.tsx index 2603cdc004..6276f24cd0 100644 --- a/apps/designer/app/shared/design-system/components/combobox.tsx +++ b/apps/designer/app/shared/design-system/components/combobox.tsx @@ -3,12 +3,12 @@ import { CheckIcon } from "@radix-ui/react-icons"; import { Popper, PopperContent, PopperAnchor } from "@radix-ui/react-popper"; import { useCombobox } from "downshift"; import { matchSorter } from "match-sorter"; -import { styled, type CSS } from "../stitches.config"; +import { styled } from "../stitches.config"; import { itemCss } from "./menu"; import { panelStyles } from "./panel"; import { IconButton } from "./icon-button"; import { TextField } from "./text-field"; -import { Box } from "./box"; +import { Box, Grid } from ".."; type BaseItem = { label: string; disabled?: boolean }; @@ -26,9 +26,6 @@ type ComboboxProps = { inputProps: ComponentProps; toggleProps: ComponentProps; }) => JSX.Element; - // @todo should we spread those props flat? - popperProps?: ComponentProps; - listCss: CSS; }; const Listbox = styled("ul", panelStyles, { @@ -37,14 +34,17 @@ const Listbox = styled("ul", panelStyles, { overflow: "auto", // @todo need some non-hardcoded value maxHeight: 400, + minWidth: 230, +}); +const ListboxItem = styled("li", itemCss, { + padding: 0, + margin: 0, }); -const ListboxItem = styled("li", itemCss); export const Combobox = ({ items, value, name, - popperProps, listCss, onItemSelect, onItemHighlight, @@ -99,7 +99,7 @@ export const Combobox = ({ {disclosure({ inputProps, toggleProps })} {isOpen && ( - + {filteredItems.map((item, index) => { const itemProps = getItemProps({ @@ -113,9 +113,17 @@ export const Combobox = ({ }); return ( + // eslint-disable-next-line react/jsx-key - {selectedItem === item && } - {getTextValue(item)} + + {selectedItem === item && } + + {getTextValue(item)} + + ); })}