You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Numeric item keys are allowed, but an item whose key is 0 is not matched by itemKey={0}. getSelectedItem checks if (item.key && key), so it falls back to matching value; when values are duplicated, it selects the first matching item instead of the item identified by key 0.
To Reproduce
Render the component with the items and props shown below.
Read the displayed input label.
Expected behavior
The input should display Zero key, because itemKey is 0 and numeric keys are part of the declared API.
Screenshots
n/a (the selected label is sufficient to observe this behavior).
Additional details
Device: Not verified on a device; this follows from the platform-independent item lookup in src/index.js.
OS: Not applicable to the lookup; runtime reproduction not performed.
The source-level example is self-contained. A hosted Snack was not prepared because runtime checks and installs were outside the assigned authorization.
Activity