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

fix(tab): make tab respect radio groups (fix #207) #330

Merged
merged 1 commit into from Jun 9, 2020

Conversation

nickmccurdy
Copy link
Member

@nickmccurdy nickmccurdy commented Jun 9, 2020

What: make tab respect radio groups

Why: fixes bugs / inaccurate simulation with tab() naively focusing all radio buttons

How: ignore radio buttons that aren't checked or at the ends within their named groups

Checklist:

  • Documentation
  • Tests
  • Typings N/A
  • Ready to be merged

The algorithm I used to prune irrelevant radio buttons is a bit ugly and hacky because of all the edge cases, so I'd appreciate any ideas to improve it. We also might need to carefully document this change as it could cause tests to fail if they're relying on the incorrect focusing behavior (though changing incorrect functionality to fix a bug is technically not a breaking change in semver).

@codecov
Copy link

codecov bot commented Jun 9, 2020

Codecov Report

Merging #330 into master will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #330      +/-   ##
==========================================
+ Coverage   99.34%   99.37%   +0.02%     
==========================================
  Files           2        2              
  Lines         305      319      +14     
  Branches       79       84       +5     
==========================================
+ Hits          303      317      +14     
  Misses          2        2              
Impacted Files Coverage Δ
src/index.js 98.96% <100.00%> (+0.08%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9c6be8c...93da220. Read the comment docs.

@nickmccurdy nickmccurdy changed the title fix(tab): make tab respect radio groups (#207) fix(tab): make tab respect radio groups (fixes #207) Jun 9, 2020
src/index.js Show resolved Hide resolved
Copy link
Member

@benmonro benmonro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one question but looking good. Thanks for doing this!

@nickmccurdy nickmccurdy force-pushed the pr/make-tab-respect-radio-groups branch from feb77bb to 93da220 Compare June 9, 2020 12:45
@nickmccurdy nickmccurdy linked an issue Jun 9, 2020 that may be closed by this pull request
@nickmccurdy nickmccurdy changed the title fix(tab): make tab respect radio groups (fixes #207) fix(tab): make tab respect radio groups (fix #207) Jun 9, 2020
@nickmccurdy
Copy link
Member Author

Sorry I force pushed this to clean up the commit message, not realizing you reviewed. If you're okay with this for now we can merge, unless you want the behavior documented somewhere first.

@nickmccurdy nickmccurdy merged commit dbdefef into master Jun 9, 2020
@nickmccurdy nickmccurdy deleted the pr/make-tab-respect-radio-groups branch June 9, 2020 13:10
@kentcdodds
Copy link
Member

🎉 This PR is included in version 11.3.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tab with radio buttons
3 participants