adobe / adobe/spectrum-web-components
[Feat]: Support validation of Picker value without rendered child items
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 262
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 68
Description
### Code of conduct
- [X] I agree to follow this project's code of conduct.
### Impacted component(s)
Picker
### Expected behavior
When user renders a Picker that have already a value set, but the values of the menu-items will be set after initialization - Picker should run some re-comparing and update the current selection state visible in the Picker.
### Actual behavior
When user renders a Picker that have already a value set, but the values of the menu-items will be set after initialization (as this happens sometimes in our project) - the value won't be re-compared to selected value and no selection will be shown in Picker.
### Screenshots
_No response_
### What browsers are you seeing the problem in?
Chrome
### How can we reproduce this issue?
1. Go to https://studio.webcomponents.dev/edit/fFmXO9B4RPvJVzr9Hbp1/src/index.ts?p=stories
2. Compare both Pickers and their current selection
### Sample code that illustrates the problem
_No response_
### Logs taken while reproducing problem
_No response_
Contributor guide
Research direction
Start with the linked reproduction at the webcomponents.dev URL and compare the two Picker instances, especially when menu-item values are assigned after initialization. Trace the Picker selection state during that sequence; done means the existing value is re-compared and the matching selection is visible without initially rendered child items.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100