{{ message }}
fix: make balance visibility toggle keyboard-accessible - #1412
Merged
theborakompanioni merged 2 commits intoAug 9, 2026
Merged
Conversation
Convert the visibility toggle to a real <button> element so it can be focused and activated via keyboard (Tab, Enter, Space), and add an aria-label/aria-pressed reflecting hidden/shown state for screen readers.
theborakompanioni
approved these changes
Aug 9, 2026
This was referenced Aug 11, 2026
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.

Convert the visibility toggle to a real element so it can be focused and activated via keyboard (Tab, Enter, Space), and add an aria-label/aria-pressed reflecting hidden/shown state for screen readers.
What does this PR do?
The balance hide/reveal toggle (used across wallet balances, send amounts, orderbook summaries, sweep schedules) was implemented as a plain
<span onClick=...>with no keyboard support and no accessible semantics — keyboard-only and screen-reader users could not use it at all.This PR:
Changes the clickable wrapper in
ElementWithSymbols(Balance.tsx) to render a real<button type="button">when interactive, instead of a bare<span>(falls back to<span>when the toggle is disabled, preserving existing non-interactive behavior).Adds
aria-label(reusing the existingsettings.show_balance/settings.hide_balancei18n keys) andaria-pressedreflecting the current visibility state.Native
<button>semantics give keyboard focus and Enter/Space activation for free — no manualtabIndex/onKeyDownneeded.Adds 5 new tests covering accessible name,
aria-pressedstate changes, keyboard activation via Enter and Space, and confirming no button is rendered when the toggle is disabled.Fixes Balance hide/reveal toggle is not keyboard-accessible or screen-reader-friendly #1409
Visual Demo (For contributors especially)
No visual change. The toggle looks and behaves identically for mouse users. The only difference is it's now also reachable and operable via keyboard (Tab to focus, Enter/Space to activate) and properly announced by screen readers.
Verified via automated tests:
npx vitest run --project unit(808/808 relevant tests pass, including 5 new ones),tsc -bbuild clean, ESLint clean.