Improve accessibility for Toggle, TokenInputQuantity, DropdownMenu2, …#5096
Draft
benwolski wants to merge 1 commit into
Draft
Improve accessibility for Toggle, TokenInputQuantity, DropdownMenu2, …#5096benwolski wants to merge 1 commit into
benwolski wants to merge 1 commit into
Conversation
…Modal, and Tooltip components Add comprehensive ARIA attributes and keyboard navigation support across multiple components. Replace useEffect-based keyboard handlers with useCallback for better performance. Implement focus management and focus trapping in Modal component. Add proper semantic roles and ARIA labels throughout. Fix Toggle component to use 'switch' role instead of 'checkbox' and improve keyboard event handling. Update
✅ Deploy Preview for dev-ambi ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for futa-finance ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for plume-ambient-finance ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
…Modal, and Tooltip components
Add comprehensive ARIA attributes and keyboard navigation support across multiple components. Replace useEffect-based keyboard handlers with useCallback for better performance. Implement focus management and focus trapping in Modal component. Add proper semantic roles and ARIA labels throughout. Fix Toggle component to use 'switch' role instead of 'checkbox' and improve keyboard event handling. Update
Describe your changes
Summary of Fixes
1. Toggle Component (
@/Users/benwolski/code/croc/ambient-ts-app/src/components/Form/Toggle.tsx)handleToggle()(was just referencing it)document.addEventListenerwith component-scopedonKeyDownhandlerariaLabelprop for screen reader supportrolefromcheckboxtoswitch(more semantically correct)aria-disabledattributetabIndexnow-1when disabled2. Tooltip Component (
@/Users/benwolski/code/croc/ambient-ts-app/src/components/Global/Tooltip/Tooltip.tsx)onFocus/onBlurhandlers for keyboard accessibilityrole="tooltip"for screen readersaria-describedbyrelationship using unique ID3. Modal Component (
@/Users/benwolski/code/croc/ambient-ts-app/src/components/Global/Modal/Modal.tsx)<button>element withtabIndex={0}(was icon withtabIndex={-1})aria-labelledbyattribute4. DropdownMenu2 (
@/Users/benwolski/code/croc/ambient-ts-app/src/components/Global/DropdownMenu2/DropdownMenu2.tsx)role="button",aria-haspopup="menu",aria-expanded,aria-disabledtabIndexfor keyboard focus5. TokenInputQuantity (
@/Users/benwolski/code/croc/ambient-ts-app/src/components/Form/TokenInputQuantity.tsx)inputAriaLabelprop for custom labelsaria-labelusing token symbolaria-disabledattributetype="string"totype="text"(valid HTML)