Internal issue 3097 - Selects don't properly support falsy values
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 53
- Forks
- 63
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 15
Description
---
name: "\U0001F41B Report a bug"
about: Tell us about a problem with the UI Kit or Design System website.
title: ''
labels: 'type: bug 🐛'
assignees: ''
type: 'Bug'
---
### Summary of the bug
Selects don't properly support falsy values. A falsy value e.g 0 will be ignored, and the label will be used as the value instead.
### 🪜 How to reproduce
https://stackblitz.com/edit/cv3jhhuf-rejyzfts?file=src%2Fapp.jsx
### 📸 Screenshots or code
If you can, add screenshots to show the problem. If you need to show a code example, you can include a snippet or link to a repository with an example.
### 🖥 📱 Device
- Type: [e.g. Desktop, mobile]
- Device: [e.g. iPhone, MacBook, ThinkPad]
- OS version: [e.g. macOS13, iOS16, Android 13]
- Browser version: [e.g. Chrome 115, Safari 16]
### 🧐 Expected behaviour
Selects should properly handle falsy values and labels, e.g 0 and false. The label should not be used as the value in the event when the value is falsy.
### 📝 Acceptance Criteria
If relevant, describe in full detail the different interactions and edge cases that the component or patterns needs to fulfil.
*Given*
*When*
*Then*
### 🚨 Urgency (low, medium or high)
Medium
### Additional info
Tell us anything else useful to help us fix or understand the pr
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked StackBlitz reproduction at src/app.jsx and trace the Select component used there into the repository implementation. Add focused coverage for numeric 0 and boolean false values, then verify that emitted events preserve those values rather than substituting the label.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100