Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Controlled ToggleGroup sets focus to old item #1473

Closed
Barsnes opened this issue Feb 1, 2024 · 6 comments
Closed

Controlled ToggleGroup sets focus to old item #1473

Barsnes opened this issue Feb 1, 2024 · 6 comments
Assignees
Labels
🐛 bug Something isn't working

Comments

@Barsnes
Copy link
Member

Barsnes commented Feb 1, 2024

Description of the bug

If we have a controlled ToggleGroup, it will always select the wrong item when tabbing to it, if the state has changed.

If we have 1, 2, 3 as items, and we have selected 3, it will set focus to that item when tabbing to the ToggleGroup.

However, if we update the current value to be 2, it will still set focus to item 3.

Steps To Reproduce

Use the controlled example in storybook: https://storybook.designsystemet.no/?path=/story/felles-togglegroup--controlled

Additional Information

No response

@Barsnes Barsnes added the 🐛 bug Something isn't working label Feb 1, 2024
@mrosvik mrosvik moved this from 🔵 Inbox to 📋 Backlog in Team Designsystemet Feb 2, 2024
@mrosvik mrosvik added this to the V1 milestone Jun 3, 2024
@mrosvik mrosvik moved this from 📋 Backlog to 📄 Todo in Team Designsystemet Jun 3, 2024
@mrosvik
Copy link
Member

mrosvik commented Jun 3, 2024

Is this still relevant? @Barsnes

@Barsnes
Copy link
Member Author

Barsnes commented Jun 3, 2024

Is this still relevant? @Barsnes

yes this should still be an issue, afaik

@Barsnes
Copy link
Member Author

Barsnes commented Jun 26, 2024

This is an issue in RovingTabIndex, and will affect all components using this.
Will look into fixing this before we expose it in #2130

@eirikbacker
Copy link
Contributor

Good opportunity to test https://u-elements.github.io/u-elements/elements/u-tabs? ☺️

@Barsnes Barsnes moved this from 📄 Todo to 🏗 In progress in Team Designsystemet Jun 26, 2024
@Barsnes
Copy link
Member Author

Barsnes commented Jun 26, 2024

This should have been fixed in 8a287f8

@Barsnes
Copy link
Member Author

Barsnes commented Jun 27, 2024

Resolved in #2130

@Barsnes Barsnes closed this as completed Jun 27, 2024
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Team Designsystemet Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

3 participants