-
-
Notifications
You must be signed in to change notification settings - Fork 0
♿ improve homepage accessibility by fixing aria children issue #337
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
base: master
Are you sure you want to change the base?
Conversation
|
Deployment failed with the following error: |
|
Deployment failed with the following error: |
da757ec to
149cf64
Compare
|
Deployment failed with the following error: |
| <Tabs | ||
| defaultValue="" | ||
| value={pathname.replace("/", "")} | ||
| onValueChange={handleTabChange} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alors c'est plutot étrange de faire cela sachant que tu as encore les Link avec un href=Routes.machin, ce qui envoie l'utilisateur 2 fois sur la page.
Et de mon coté je préfère garder les liens plutot que un callback avec le router.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Effectivement, c'est une erreur de ma part, je n'ai pas retiré l'ancienne méthode que j'avais utilisé.
J'ai besoin d'un avis, j'ai quatre méthodes imparfaites à proposer pour régler les soucis d'accessibilités dans cette PR :
- Soit je passe par un handleChange comme j'avais fait au début, ce qui résous tous les audits d'accessibilité sur ce component mais créer visiblement de l'obfuscation
- Soit je passe par un Link à l'intérieur des TabTrigger mais il subsiste un défaut de Touch target
- Soit je passe par un Link à l'intérieur des TabTrigger et j'applique une value asChild aux TabTrigger mais cela créer un soucis d'hydration
- Soit je passe par un Link à l'intérieur des TabTrigger et je lui met une class min-h-[36px] ce qui résous le souci de touch target mais modifie le design du button.
Une préférence entre ces 4 propositions ?
149cf64 to
db48bfa
Compare
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes an accessibility issue in the PageSwitcher component by ensuring proper ARIA relationships between tab triggers and their corresponding content panels, and it adds programmatic navigation for tab changes.
- Added
TabsContentpanels with matchingidandaria-controls - Introduced
onValueChangehandler using Next.js router for tab navigation - Refactored
TabsTriggermarkup to includeidandaria-controls
Comments suppressed due to low confidence (2)
src/components/marketing/landing/page-switcher/index.tsx:39
- [nitpick] Using an empty string for the visitor tab value can be ambiguous. Consider using a descriptive identifier (e.g.,
"visitor") to improve clarity and consistency.
<TabsTrigger value="" id="tab-trigger-visitor" aria-controls="tab-content-visitor">
src/components/marketing/landing/page-switcher/index.tsx:24
- Add tests to verify that
onValueChangecorrectly navigates to the intended route and that all ARIA attributes (id,aria-controls,aria-labelledby) are present and correct for each tab and panel.
onValueChange={handleTabChange}
This modification fix accessibility issue in Lighthouse audit test for PageSwitcher