fix: remove duplicate main landmark and make calculator tabs arrow-operable#975
Merged
Merged
Conversation
|
@Anexus5919 is attempting to deploy a commit to the somiljain2024-4175's projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Author
|
@Somil450 @diksha78dev Kindly have a review on this pr. Thanks! |
…erable FitnessCalculator declared role="main" while rendering inside App's <main>, producing two main landmarks on the page. The tab bar already had the ARIA tab roles but no keyboard support: every tab was in the tab order and arrow keys did nothing. Drop the redundant role="main", and implement the WAI-ARIA tabs keyboard pattern: roving tabindex (only the selected tab is tabbable) plus Arrow, Home, and End handling that moves selection and focus.
6987fed to
b0d2986
Compare
Contributor
Author
|
@Somil450 @diksha78dev Kindly have a review on this pr. Thanks! |
Contributor
Author
|
This failing check is from |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 Related Issue
Fixes #892 (addresses A11Y-4 and A11Y-5)
📝 Description
Two accessibility problems in
FitnessCalculator.🔹 What has been changed?
mainlandmark):FitnessCalculatordeclaredrole="main"while rendering inside App's<main>, producing two main landmarks. Removed it (and the now-redundantaria-label).tabIndex(only the selected tab is tabbable) plus anonKeyDownhandler for Arrow keys and Home/End that moves selection and focus.🔹 Why are these changes needed?
mainlandmark, and an ARIA tablist should be a single tab stop navigable with Arrow keys. The previous code had twomainlandmarks and tabs that weren't arrow-operable.🛠️ Type of Change
🧪 Testing
✅ Tests Performed
npx tsc --noEmitandnpx eslint src/components/FitnessCalculator.tsxclean.role="main"is removed.🔹 Note on automated tests
No committed test: keyboard/landmark behavior needs
@testing-library/react, which can't currently run (@testing-library/domevicted fromnode_modules).🌐 Browsers Tested
Not applicable here (landmark/keyboard behavior; visible in the DevTools Accessibility pane).
📷 Screenshots / Demo (if applicable)
Not applicable.
📋 Checklist
💬 Additional Notes
Branched from
upstream/main; merges cleanly with the current base.