fix(select): falsy item text should not override value

Fixes #2117
This commit is contained in:
Eric Liu 2025-03-11 09:22:04 -07:00
commit 19c7e12cb4
3 changed files with 18 additions and 1 deletions

View file

@ -0,0 +1,9 @@
<script lang="ts">
import { Select, SelectItem } from "carbon-components-svelte";
</script>
<Select labelText="Falsy text">
<SelectItem value={-1} text="" />
<SelectItem value={0} text="Zero" />
<SelectItem value={1} text="One" />
</Select>