Skip to content

fix: give TransactionButton an accessible name while a transaction is in progress - #2676

Open
owenpkent wants to merge 1 commit into
coinbase:mainfrom
owenpkent:fix/transaction-button-accessible-name
Open

fix: give TransactionButton an accessible name while a transaction is in progress#2676
owenpkent wants to merge 1 commit into
coinbase:mainfrom
owenpkent:fix/transaction-button-accessible-name

Conversation

@owenpkent

Copy link
Copy Markdown

What changed? Why?

Fixes #2675.

TransactionButton replaces its label with a bare <Spinner /> while a transaction is being signed or is pending. Spinner renders no text, so the <button> has no accessible name for the whole time it is disabled. axe-core reports it as button-name (WCAG 4.1.2), and a screen reader user who has just submitted a transaction is told nothing about the control they were on.

This adds aria-label="Transaction in progress" and aria-busy="true" to the button for exactly the branch that shows the spinner (no receipt, no error, isLoading). Both come off again as soon as the button reads "View transaction", "Try again" or the idle text, so the visible label stays the accessible name in every other state.

The wording is the one the codebase already uses: CheckoutButton sets aria-label={isLoading ? 'Transaction in progress' : buttonText}, and TransactionToastLabel shows "Transaction in progress" for the same state, so the button and the status line now say the same thing.

The render prop path is unchanged. Custom renderers already receive status and own their own markup.

Notes to reviewers

  • Scoped to TransactionButton, which is what the issue reports. The same spinner swap happens in SwapButton, BuyButton, FundButton, NFTMintButton, ConnectWallet and the earn and send render buttons, and none of them set a name while loading. Happy to follow up on those separately if wanted.
  • aria-busy is only rendered while pending rather than as aria-busy="false" the rest of the time, so the idle DOM is exactly as before.
  • Changeset included (patch).

How has it been tested?

  • Three new tests in TransactionButton.test.tsx: the button is found by role with the name "Transaction in progress" and carries aria-busy="true" while loading; the visible text is the name and neither attribute is present when idle; and the "View transaction" and "Try again" states are unaffected even with isLoading still true. pnpm f:ock test:coverage, pnpm f:ock lint and prettier all pass locally.
  • Re-ran the axe-core and IBM Equal Access scans that found the issue against the built package, in a small Vite app with an injected test EIP-1193 wallet that can hold a transaction in the approving and pending states. axe button-name: 2 occurrences before (approving, pending), 0 after. Equal Access input_label_exists: 2 before, 0 after. No other finding changed, apart from two unrelated color-contrast hits on the confirmed state's toast that did not recur on the second run.

… in progress

While a transaction is being signed or is pending, TransactionButton
renders a bare Spinner and nothing else, so the disabled button has no
accessible name (axe button-name, WCAG 4.1.2).

Set aria-label="Transaction in progress" and aria-busy="true" for exactly
the branch that shows the spinner, matching the wording CheckoutButton and
TransactionToastLabel already use, and drop both again once the button
shows "View transaction", "Try again" or the idle text.

Fixes coinbase#2675
@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

@owenpkent is attempting to deploy a commit to the Coinbase Team on Vercel.

A member of the Team first needs to authorize it.

@cb-heimdall

Copy link
Copy Markdown

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/2
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 1
Sum 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Bug: TransactionButton has no accessible name while a transaction is approving or pending

2 participants