Checkbox checked state isn't reflecting checked state as expected
- Dominant language
- JavaScript
- Stars
- 82
- Forks
- 36
- PR merge metrics
- No merged PRs in 30d
Description
When creating a checkbox with the `isSelected` prop, I'm expecting it to be the single source of truth, but it seems that the checkbox has its own local state, that toggles the checked state.
To replicate:
- Create checkbox with `isSelected={true}`
- Checkbox does successfully render initially with a selected checkbox
- Click the checkbox
- Expecting the checkbox to not be checked, as the passed prop is still `true`
Not sure if this is as intended, but it gets in the way when we don't want the checkbox to behave on its own, such as when the checkbox checked state shouldn't occur until a popup is confirmed.
Contributor guide
Research direction
The issue does not name an implementation file or test. Start by locating the checkbox component entry point and its existing tests, then verify how isSelected behaves after a click. Done means the rendered state continues to follow the prop when the parent value has not changed, including the popup-confirmation scenario.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100