Skip to content

feat: add title attribute to TruncatedAddress copy button (Closes #868) - #976

Open
waterWang wants to merge 1 commit into
scout-off:mainfrom
waterWang:a11y/truncated-address-title-868
Open

feat: add title attribute to TruncatedAddress copy button (Closes #868)#976
waterWang wants to merge 1 commit into
scout-off:mainfrom
waterWang:a11y/truncated-address-title-868

Conversation

@waterWang

Copy link
Copy Markdown

Summary

Adds a title="Copy full address to clipboard" attribute to the copy button inside TruncatedAddress.tsx. The element already had a matching aria-label, but the title attribute provides a native tooltip-on-hover for sighted mouse users, closing the gap for pointer-based users who may not discover the button role via screen readers.

Changes

  • components/ui/TruncatedAddress.tsx: Added title="Copy full address to clipboard" to the <button> element.
  • __tests__/components/TruncatedAddress.test.tsx: Added a new test case "has a title attribute on the copy button for tooltip-on-hover" that asserts the title attribute is present and matches the expected value.

Acceptance Criteria

  • The copy button has a non-empty aria-label (already present: "Copy full address to clipboard").
  • A title attribute with the same value is present for sighted mouse users.
  • npm test passes (7/7 tests).

Closes #868

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add title attribute to TruncatedAddress copy button

1 participant