diff --git a/packages/builder/src/components/userInterface/OptionSelect.svelte b/packages/builder/src/components/userInterface/OptionSelect.svelte index aac5c44c07..1c3ee89213 100644 --- a/packages/builder/src/components/userInterface/OptionSelect.svelte +++ b/packages/builder/src/components/userInterface/OptionSelect.svelte @@ -6,13 +6,14 @@ export let options = [] export let value = "" export let styleBindingProperty - export let onChange = value => {} + export let onChange = (value) => {} let open = null let rotate = "" let select let selectMenu let icon + let width = 0 let selectAnchor = null let dimensions = { top: 0, bottom: 0, left: 0 } @@ -22,7 +23,7 @@ let scrollTop = 0 let containerEl = null - const handleStyleBind = value => + const handleStyleBind = (value) => !!styleBindingProperty ? { style: `${styleBindingProperty}: ${value}` } : {} onMount(() => { @@ -91,12 +92,13 @@ "transform-origin": `center ${positionSide}`, [positionSide]: `${dimensions[positionSide]}px`, left: `${dimensions.left.toFixed(0)}px`, + width: `${width}px`, }) - $: isOptionsObject = options.every(o => typeof o === "object") + $: isOptionsObject = options.every((o) => typeof o === "object") $: selectedOption = isOptionsObject - ? options.find(o => o.value === value) + ? options.find((o) => o.value === value) : {} $: if (open && selectMenu) { @@ -108,6 +110,7 @@