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

Fixes #2117
This commit is contained in:
Eric Liu 2025-03-11 10:09:28 -07:00 committed by GitHub
commit 663b79ad05
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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>