Open ItaiYosephi opened 3 months ago
When opening a dialog with ToggleGroup being the first element, focus is applied to the next tabable element. seems like ToggleGroup start with tabindex="-1" and only after the first render it changes to 0
ToggleGroup
tabindex="-1"
0
https://github.com/user-attachments/assets/f66f172e-b55c-4c93-a77b-b2012222ed12
ToggleGroup should be focused when dialog opens.
CodeSandbox Template
Seems like it should start with tabindex="0" by deafult, please see this comment: https://github.com/ariakit/ariakit/issues/4055#issuecomment-2298796742
Bug report
Current Behavior
When opening a dialog with
ToggleGroup
being the first element, focus is applied to the next tabable element. seems like ToggleGroup start withtabindex="-1"
and only after the first render it changes to0
https://github.com/user-attachments/assets/f66f172e-b55c-4c93-a77b-b2012222ed12
Expected behavior
ToggleGroup
should be focused when dialog opens.Reproducible example
CodeSandbox Template
Suggested solution
Seems like it should start with tabindex="0" by deafult, please see this comment: https://github.com/ariakit/ariakit/issues/4055#issuecomment-2298796742