fix PhoneInput combobox icon override

This commit is contained in:
2026-05-06 19:06:41 -07:00
parent e8440bc106
commit 7386bff7be
+8 -9
View File
@@ -50,8 +50,7 @@
const options: ComboboxOption[] = countries.map((country) => ({
value: country.isoCode,
label: `${country.name} (+${country.phonecode})`,
preview: `+${country.phonecode}`,
icon: renderIcon
preview: `+${country.phonecode}`
}));
let phonecode: string = $derived.by(() => {
@@ -118,12 +117,6 @@
});
</script>
{#snippet renderIcon(item: ComboboxOption)}
{#if countrycodeMap[item.value]?.flag}
{countrycodeMap[item.value].flag}
{/if}
{/snippet}
<div class={classValue}>
{#if label}
<Label for={id}>{label}</Label>
@@ -149,7 +142,13 @@
countriesValid = e.detail.valid;
}}
invalidMessage={null}
/>
>
{#snippet iconRender(opt)}
{#if countrycodeMap[opt.value]?.flag}
{countrycodeMap[opt.value].flag}
{/if}
{/snippet}
</Combobox>
</div>
<div class="w-full">