Skip to content

Adding CopyToClipboard functionality in Colors page - #564

Merged
Dipesh Kumar (dipeshmsft) merged 2 commits into
mainfrom
colors-copy
May 7, 2024
Merged

Adding CopyToClipboard functionality in Colors page#564
Dipesh Kumar (dipeshmsft) merged 2 commits into
mainfrom
colors-copy

Conversation

@dipeshmsft

@dipeshmsft Dipesh Kumar (dipeshmsft) commented May 7, 2024

Copy link
Copy Markdown
Member
Microsoft Reviewers: Open in CodeFlow

@dipeshmsft
Dipesh Kumar (dipeshmsft) deleted the colors-copy branch August 26, 2024 07:37
Vinay Narayana (vinnarayana-msft) pushed a commit that referenced this pull request Jul 30, 2026
…Icons pages (AB#3036673)

Remove FocusManager.IsFocusScope="True" from the copy buttons in ColorTile
(Design Guidance -> Color) and IconDataField (Design Guidance -> Icons).

The focus scope split logical focus from keyboard focus, so tabbing to a
copy button that was scrolled out of view did not raise the framework's
IsKeyboardFocused -> BringIntoView, leaving the newly focused button
invisible (a WCAG 2.4.3 / 2.4.7 focus-order/focus-visible issue).

IsFocusScope was never needed on these buttons:
- ColorTile routes ApplicationCommands.Copy via an explicit CommandTarget
  plus a class CommandBinding, so command routing is focus-independent.
  (It was added in #564 as plumbing for a target-less Copy command and made
  redundant by the explicit CommandTarget added in #583.)
- IconDataField copies via a Click handler (CopyButton_Click), which does
  not depend on focus at all.

With the focus scope removed, Tab now scrolls the focused copy button into
view on both pages, and copy-to-clipboard continues to work.

ControlExample's source-code copy buttons are intentionally left unchanged;
their tab/scroll behavior is already correct.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 45ee703e-394b-4bdc-a77b-94f2933a5a6d
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.

2 participants