Bug report
Current behavior
When tabs and tabpanels are not given a value, and Tabs.Root is not provided with a value or defaultValue, the component automatically picks the first tab as the selected tab (hence why defaultValue has a default value of 0).
When this happens, the onValueChange callback does not fire, even if the selected tab changed, caused by an external factor (from the POV of the consumer).
Expected behavior
I'd expect the onValueChange callback to fire when the component internally picks a selected tab.
Reproducible example
https://codesandbox.io/p/sandbox/elated-microservice-wl4sl2
Notice how alert doesn't fire initially, while it fires for every subsequent user interaction.
Base UI version
1.0.0-beta.0
Which browser are you using?
Chrome
Which OS are you using?
Mac OS
Which assistive tech are you using (if applicable)?
N/A
Additional context
I understand this may be an opinionated take — in any case, whatever is decided, it shoud be applied to all components whenever a value changes for reasons out of the consumer's control (and not just tabs).
Bug report
Current behavior
When tabs and tabpanels are not given a value, and
Tabs.Rootis not provided with avalueordefaultValue, the component automatically picks the first tab as the selected tab (hence whydefaultValuehas a default value of0).When this happens, the
onValueChangecallback does not fire, even if the selected tab changed, caused by an external factor (from the POV of the consumer).Expected behavior
I'd expect the
onValueChangecallback to fire when the component internally picks a selected tab.Reproducible example
https://codesandbox.io/p/sandbox/elated-microservice-wl4sl2
Notice how
alertdoesn't fire initially, while it fires for every subsequent user interaction.Base UI version
1.0.0-beta.0Which browser are you using?
Chrome
Which OS are you using?
Mac OS
Which assistive tech are you using (if applicable)?
N/A
Additional context
I understand this may be an opinionated take — in any case, whatever is decided, it shoud be applied to all components whenever a value changes for reasons out of the consumer's control (and not just tabs).