Skip to content

Commit d0c044c

Browse files
Copilotniels9001
andauthored
Fix accessibility issue: Hide decorative copy success glyph from screen reader navigation (#1979)
Fixes an accessibility issue where screen readers would navigate to a decorative copy button image and stay mute, violating Microsoft Accessibility Guidelines (MAS 4.2.1 - Object Information). ## Problem When users navigate with screen reader keyboard navigation (caps + arrow keys) in the Resources page, the narrator focus would land on the decorative success checkmark glyph of the copy button. This caused the narrator to stay silent, creating an "Uncomprehended Element" trap for users with visual impairments. ## Solution Added `AutomationProperties.AccessibilityView="Raw"` to the success checkmark FontIcon in the CopyButton template. This attribute hides the decorative element from the accessibility tree while preserving the main copy button's accessibility. ## Technical Details - The main copy button remains fully accessible with `AutomationProperties.Name="Copy to clipboard"` - The button properly announces "Copied to clipboard" when activated - Only the decorative success glyph (&#xE73E;) is hidden from screen reader navigation - The copy icon (&#xE8C8;) remains accessible as the button's main content This is a minimal, surgical fix that addresses the specific accessibility violation without affecting the button's functionality or visual appearance. Fixes #1964. > [!WARNING] > > <details> > <summary>Firewall rules blocked me from connecting to one or more addresses</summary> > > #### I tried to connect to the following addresses, but was blocked by firewall rules: > > - `e7bvsblobprodcus348.vsblob.vsassets.io` > - Triggering command: `dotnet restore WinUIGallery.sln` (dns block) > > If you need me to access, download, or install something from one of these locations, you can either: > > - Configure [Actions setup steps](https://gh.io/copilot/actions-setup-steps) to set up my environment, which run before the firewall is enabled > - Add the appropriate URLs or hosts to the custom allowlist in this repository's [Copilot coding agent settings](https://github.com/microsoft/WinUI-Gallery/settings/copilot/coding_agent) (admins only) > > </details> <!-- START COPILOT CODING AGENT TIPS --> --- 💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click [here](https://survey.alchemer.com/s3/8343779/Copilot-Coding-agent) to start the survey. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: niels9001 <9866362+niels9001@users.noreply.github.com> Co-authored-by: Niels Laute <niels.laute@live.nl>
1 parent 177e25c commit d0c044c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

WinUIGallery/Controls/CopyButton.xaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@
148148
x:Name="ContentPresenter"
149149
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
150150
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
151+
AutomationProperties.AccessibilityView="Raw"
151152
Content="{TemplateBinding Content}"
152153
ContentTemplate="{TemplateBinding ContentTemplate}"
153154
ContentTransitions="{TemplateBinding ContentTransitions}"
@@ -161,13 +162,17 @@
161162
</ContentPresenter>
162163
<ContentPresenter
163164
x:Name="CopySuccessGlyph"
165+
AutomationProperties.AccessibilityView="Raw"
164166
Foreground="{TemplateBinding Foreground}"
165167
Opacity="0"
166168
RenderTransformOrigin=".5,.5">
167169
<ContentPresenter.RenderTransform>
168170
<ScaleTransform x:Name="CopyToClipboardSuccessTextScaleTransform" />
169171
</ContentPresenter.RenderTransform>
170-
<FontIcon FontSize="{TemplateBinding FontSize}" Glyph="&#xE73E;" />
172+
<FontIcon
173+
AutomationProperties.AccessibilityView="Raw"
174+
FontSize="{TemplateBinding FontSize}"
175+
Glyph="&#xE73E;" />
171176
</ContentPresenter>
172177

173178
<VisualStateManager.VisualStateGroups>

0 commit comments

Comments
 (0)