Skip to content

Commit

Permalink
Fixing Accessibility Issue in Expander
Browse files Browse the repository at this point in the history
1. Changed the name of Toggle Button in expander to fix the narrator issue. (#9255)
2. Added the Automation Name to the Toggle Button
  • Loading branch information
himgoyalmicro authored Jun 17, 2024
1 parent bfd8cac commit 4f719ed
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,8 @@
BorderThickness="1"
CornerRadius="{TemplateBinding Border.CornerRadius}">
<ToggleButton
x:Name="ExpanderToggleButton"
x:Name="HeaderSite"
AutomationProperties.Name="{TemplateBinding AutomationProperties.Name}"
Margin="0"
Padding="{TemplateBinding Padding}"
HorizontalAlignment="Stretch"
Expand Down Expand Up @@ -550,7 +551,7 @@
TargetName="ToggleButtonBorder"/>
<Setter Property="Template"
Value="{StaticResource DefaultExpanderToggleButtonRightStyle}"
TargetName="ExpanderToggleButton"/>
TargetName="HeaderSite"/>
<Setter Property="RenderTransform"
Value="{DynamicResource WidthAnimation}"
TargetName="ContentPresenterBorder" />
Expand All @@ -566,7 +567,7 @@
TargetName="ToggleButtonBorder"/>
<Setter Property="Template"
Value="{StaticResource DefaultExpanderToggleButtonUpStyle}"
TargetName="ExpanderToggleButton"/>
TargetName="HeaderSite"/>
<Setter Property="RenderTransform"
Value="{DynamicResource HeightAnimation}"
TargetName="ContentPresenterBorder" />
Expand All @@ -589,7 +590,7 @@
TargetName="ToggleButtonBorder"/>
<Setter Property="Template"
Value="{StaticResource DefaultExpanderToggleButtonLeftStyle}"
TargetName="ExpanderToggleButton"/>
TargetName="HeaderSite"/>
<Setter Property="RenderTransform"
Value="{DynamicResource WidthAnimation}"
TargetName="ContentPresenterBorder" />
Expand All @@ -598,12 +599,12 @@
<Trigger Property="IsEnabled"
Value="False">
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource ExpanderHeaderDisabledForeground}" />
<Setter TargetName="ExpanderToggleButton" Property="Foreground" Value="{DynamicResource ExpanderHeaderDisabledForeground}" />
<Setter TargetName="ExpanderToggleButton" Property="BorderBrush" Value="{DynamicResource ExpanderHeaderDisabledBorderBrush}" />
<Setter TargetName="HeaderSite" Property="Foreground" Value="{DynamicResource ExpanderHeaderDisabledForeground}" />
<Setter TargetName="HeaderSite" Property="BorderBrush" Value="{DynamicResource ExpanderHeaderDisabledBorderBrush}" />
</Trigger>

<Trigger SourceName="ExpanderToggleButton" Property="IsMouseOver" Value="True">
<Setter TargetName="ExpanderToggleButton" Property="BorderBrush" Value="{DynamicResource ExpanderHeaderBorderPointerOverBrush}" />
<Trigger SourceName="HeaderSite" Property="IsMouseOver" Value="True">
<Setter TargetName="HeaderSite" Property="BorderBrush" Value="{DynamicResource ExpanderHeaderBorderPointerOverBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
Expand Down

0 comments on commit 4f719ed

Please sign in to comment.