fix(a11y): reveal Copyable's CopyButton on focus-within (WCAG 2.1.1)#3452
Merged
Conversation
The Copyable primitive hides its CopyButton behind 'invisible group-hover:visible'. Tailwind's 'invisible' compiles to visibility: hidden, which removes the element from the focus order -- Tab skips it entirely. Mouse users can hover to reveal and click; keyboard users in default mode have no way to invoke copy at all. Add 'group-focus-within:visible' alongside the existing 'group-hover:visible' so the button becomes visible (and therefore focus-eligible) whenever focus moves anywhere inside the wrapping group -- typically when the user Tabs onto the slot's content (workflow IDs, run IDs, etc.). The next Tab now lands on the CopyButton, where Enter or Space triggers copy. Applied to both branches (clickAllToCopy and default mode). Affects detail-list value cells, event-summary rows, and every other Copyable consumer in default mode. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ardiewen
approved these changes
May 29, 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.
Summary
The
Copyableprimitive hides itsCopyButtonbehindinvisible group-hover:visible. Tailwind'sinvisiblecompiles tovisibility: hidden, which removes the element from the focus order — Tab skips it entirely. Mouse users can hover to reveal and click; keyboard users in default mode have no way to invoke copy at all.This PR adds
group-focus-within:visiblealongside the existinggroup-hover:visibleso the button becomes visible (and focus-eligible) whenever focus moves anywhere inside the wrapping group.<CopyButton {copyIconTitle} {copySuccessIconTitle} - class={visible ? 'visible' : 'invisible group-hover:visible'} + class={visible + ? 'visible' + : 'invisible group-hover:visible group-focus-within:visible'} on:click={handleOnClick} copied={$copied} />Applied to both branches (
clickAllToCopyand default mode).Keyboard contract after fix
<Link>inside):focus-within)Audit context
Copyableconsumer — detail-list value cells (workflow ID, run ID), event-summary rows, etc.Browser support
:focus-withinis supported in all evergreen browsers.Test plan
copyIconTitle.clickAllToCopymode still works for both keyboard (Enter on outer button) and mouse.🤖 Generated with Claude Code
A11y-Audit-Ref: 2.1.1-copyable-focus-within