From 22e8b4a14124bbd2434738c2fbb6220bd84ab84f Mon Sep 17 00:00:00 2001 From: "Maria Manolova (INFRAGISTICS INC)" Date: Fri, 24 Jul 2026 13:10:50 +0300 Subject: [PATCH] Fix keyboard focus not scrolling copy buttons into view on Color and 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 --- Sample Applications/WPFGallery/Controls/ColorTile.xaml | 1 - Sample Applications/WPFGallery/Controls/IconDataField.xaml | 1 - 2 files changed, 2 deletions(-) diff --git a/Sample Applications/WPFGallery/Controls/ColorTile.xaml b/Sample Applications/WPFGallery/Controls/ColorTile.xaml index 8fadd78e5..59bf23b23 100644 --- a/Sample Applications/WPFGallery/Controls/ColorTile.xaml +++ b/Sample Applications/WPFGallery/Controls/ColorTile.xaml @@ -56,7 +56,6 @@ Foreground="{TemplateBinding Foreground}" Command="ApplicationCommands.Copy" CommandTarget="{Binding RelativeSource={RelativeSource AncestorType={x:Type controls:ColorTile}}}" - FocusManager.IsFocusScope="True" ToolTipService.ToolTip="Copy brush name"> diff --git a/Sample Applications/WPFGallery/Controls/IconDataField.xaml b/Sample Applications/WPFGallery/Controls/IconDataField.xaml index 32846c0a8..7449c97df 100644 --- a/Sample Applications/WPFGallery/Controls/IconDataField.xaml +++ b/Sample Applications/WPFGallery/Controls/IconDataField.xaml @@ -29,7 +29,6 @@