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
I am managing selectedTabId and items in the local state. When I dynamically add a new tab, I update the items list and set the new tab's ID as the selectedTabId. However, when selectedTabId changes, the onSelectionChange event is triggered with the ID of the first tab in the items list, causing the selectedTabId to revert to the first tab's ID.
🤔 Expected Behavior?
Set the newly created tab ID as the selectedTabId.
😯 Current Behavior
The ID of the first tab in the items list is being set as the selectedTabId.
💁 Possible Solution
When the selectedTabId changes, it should be passed as an argument to the onSelectionChange callback.
Provide a general summary of the issue here
I am managing
selectedTabId
anditems
in the local state. When I dynamically add a new tab, I update theitems
list and set the new tab's ID as theselectedTabId
. However, whenselectedTabId
changes, theonSelectionChange
event is triggered with the ID of the first tab in theitems
list, causing theselectedTabId
to revert to the first tab's ID.🤔 Expected Behavior?
Set the newly created tab ID as the
selectedTabId
.😯 Current Behavior
The ID of the first tab in the
items
list is being set as theselectedTabId
.💁 Possible Solution
When the
selectedTabId
changes, it should be passed as an argument to theonSelectionChange
callback.🔦 Context
No response
🖥️ Steps to Reproduce
https://codesandbox.io/p/sandbox/cmtrmq
Version
"react-aria-components": "1.3.3"
What browsers are you seeing the problem on?
Chrome
If other, please specify.
No response
What operating system are you using?
Ubuntu 20.04.6 LTS
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
The text was updated successfully, but these errors were encountered: