diff --git a/apps/designer/app/designer/features/style-panel/controls/select/select-control.tsx b/apps/designer/app/designer/features/style-panel/controls/select/select-control.tsx index b09942843e..7f11a16f29 100644 --- a/apps/designer/app/designer/features/style-panel/controls/select/select-control.tsx +++ b/apps/designer/app/designer/features/style-panel/controls/select/select-control.tsx @@ -1,4 +1,5 @@ import { Select } from "@webstudio-is/design-system"; +import { useMemo } from "react"; import { getFinalValue } from "../../shared/get-final-value"; import type { ControlProps } from "../../style-sections"; @@ -15,17 +16,29 @@ export const SelectControl = ({ property: styleConfig.property, }); + const [options, selectedOption] = useMemo(() => { + const item = styleConfig.items.find((item) => item.name == value?.value); + const options = styleConfig.items.map((item) => item.label); + return [options, item?.label]; + }, [value?.value, styleConfig.items]); + if (value === undefined) return null; const setValue = setProperty(styleConfig.property); return (