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
{{ message }}
Repository navigation
Combobox not showing input value when using e defaultSelectedKey and autofocus #9389
Originally posted by francescosac95 December 22, 2025
Hey everyone,
I am using Combobox from react aria components and I am running into an issue (Uncontrolled component).
The issue is when I have the combobox on autofocus and I have a defaultSelected key, the input value is empty. When I blur out I can see the right input value for the default selected key.
When I remove the autofocus everything works as expected, on initial render I can see the default selected key with the right input value.
Am I missing something? Is this how it's supposed to be working or is it a bug?
runs and the input field is NOT yet focused but autoFocus, we'd ideally have a input value from the selected key, but the collection isn't available yet. In subsequent renders, the field is already focused which means we won't overwrite the input field's value as per the above code comment.
Activity
LFDanLu commentedon Dec 22, 2025
I believe this is due to the nature of autoFocus and the 2 render pass that RAC collections need to build. The moment
react-spectrum/packages/@react-stately/combobox/src/useComboBoxState.ts
Lines 261 to 270 in eec6c1a