-
Notifications
You must be signed in to change notification settings - Fork 5.2k
fix: add focus state to swaps input for improved accessibility #29252
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
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
… keyboard and vision impaired users
61b2152
to
43eed26
Compare
@@ -893,6 +893,7 @@ export default function PrepareSwapPage({ | |||
display={DISPLAY.FLEX} | |||
justifyContent={JustifyContent.spaceBetween} | |||
alignItems={AlignItems.center} | |||
gap={4} |
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.
outline: none; | ||
margin-right: -4px; | ||
|
||
input { | ||
padding-right: 0; | ||
padding-right: 4px; |
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.
Negative margin allows for alignment and padding of number to remain the same while input is in focus state
Builds ready [43eed26]
Page Load Metrics (2047 ± 150 ms)
Bundle size diffs
|
Tested: |
Description
The current swaps input implementation hides the focus indicator, making it inaccessible for users with vision impairments and those relying on keyboard navigation. This creates barriers for:
This PR improves accessibility by:
These changes ensure compliance with WCAG 2.1 Success Criterion 2.4.7 (Focus Visible), which requires that keyboard focus indicators be visible and distinguishable.
Related issues
Fixes: #26662
Manual testing steps
Screenshots/Recordings
Before
Input field shows no focus indicator when navigating with keyboard
before.mov
After
Input field shows clear focus indicator when navigating with keyboard, with padding-right: 4px
after720.mov
Pre-merge author checklist
Pre-merge reviewer checklist