fix PhoneInput combobox icon override
This commit is contained in:
@@ -50,8 +50,7 @@
|
|||||||
const options: ComboboxOption[] = countries.map((country) => ({
|
const options: ComboboxOption[] = countries.map((country) => ({
|
||||||
value: country.isoCode,
|
value: country.isoCode,
|
||||||
label: `${country.name} (+${country.phonecode})`,
|
label: `${country.name} (+${country.phonecode})`,
|
||||||
preview: `+${country.phonecode}`,
|
preview: `+${country.phonecode}`
|
||||||
icon: renderIcon
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
let phonecode: string = $derived.by(() => {
|
let phonecode: string = $derived.by(() => {
|
||||||
@@ -118,12 +117,6 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#snippet renderIcon(item: ComboboxOption)}
|
|
||||||
{#if countrycodeMap[item.value]?.flag}
|
|
||||||
{countrycodeMap[item.value].flag}
|
|
||||||
{/if}
|
|
||||||
{/snippet}
|
|
||||||
|
|
||||||
<div class={classValue}>
|
<div class={classValue}>
|
||||||
{#if label}
|
{#if label}
|
||||||
<Label for={id}>{label}</Label>
|
<Label for={id}>{label}</Label>
|
||||||
@@ -149,7 +142,13 @@
|
|||||||
countriesValid = e.detail.valid;
|
countriesValid = e.detail.valid;
|
||||||
}}
|
}}
|
||||||
invalidMessage={null}
|
invalidMessage={null}
|
||||||
/>
|
>
|
||||||
|
{#snippet iconRender(opt)}
|
||||||
|
{#if countrycodeMap[opt.value]?.flag}
|
||||||
|
{countrycodeMap[opt.value].flag}
|
||||||
|
{/if}
|
||||||
|
{/snippet}
|
||||||
|
</Combobox>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="w-full">
|
<div class="w-full">
|
||||||
|
|||||||
Reference in New Issue
Block a user