Fix: add keyboard accessibility to popup close icons#5882
Open
DhyaniKavya wants to merge 1 commit intosugarlabs:masterfrom
Open
Fix: add keyboard accessibility to popup close icons#5882DhyaniKavya wants to merge 1 commit intosugarlabs:masterfrom
DhyaniKavya wants to merge 1 commit intosugarlabs:masterfrom
Conversation
Contributor
|
❌ Some Jest tests failed. Please check the logs and fix the issues before merging. Failed Tests: |
Contributor
Author
2f25b32 to
aff6ffa
Compare
Contributor
|
✅ All Jest tests passed! This PR is ready to merge. |
Contributor
Author
|
@omsuneri @walterbender Rebased the branch successfully and all tests are passing now . Please review the changes, if anything needs change, i am open to address it. Thankyou |
zealot-zew
reviewed
Mar 1, 2026
Contributor
zealot-zew
left a comment
There was a problem hiding this comment.
Screen.Recording.2026-03-01.at.2.12.37.PM.mov
i can highlight the message dialog using Enter but cannot close it?
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.
issue: #5878
Problem:-
-Popup close controls (e.g., print preview and error dialogs) are implemented as elements with onclick handlers. These elements are not focusable and cannot be activated via keyboard.
-Close icons are skipped when navigating with the Tab key
-Keyboard users cannot dismiss popup dialogs
-Assistive technologies do not recognize the icons as interactive controls
-This creates an accessibility barrier and does not meet WCAG 2.1 keyboard accessibility guidelines
Solution:-
-This PR adds keyboard accessibility support to the popup close icons while preserving existing behavior.
-adds role="button" for semantic meaning
-adds tabindex="0" to enable keyboard focus
-adds keyboard activation via Enter and Space
-preserves existing click functionality
-does not alter layout, styling, or popup logic
Changes Made:-
-File modified:
->index.html
added role="button" to popup close icons⚠️ pre-existing failures on master (unrelated to this change)
added tabindex="0" to enable keyboard focus
added onkeydown handler for Enter/Space activation
ESLint: ✅ no lint errors
Tests:
Impact:-
-Enables keyboard users to dismiss popup dialogs
-Improves screen reader accessibility
-Enhances WCAG 2.1 compliance
-No functional regressions
-Minimal and safe change
Notes:-
This change is intentionally minimal and non-breaking. It improves accessibility without modifying popup logic, layout, or styling. The implementation follows standard accessibility best practices while preserving existing behavior.
Happy to refine further if maintainers prefer a different approach