Skip to content

Commit e8e3875

Browse files
authored
Fixing A11y issues in combobox and scroll bar (#9064)
* Fixing ally issues in combobox and scroll bar * Fix DatePicker textbox and button ally issues
1 parent 6c97dfe commit e8e3875

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/ComboBox.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,8 @@
245245
FontSize="{TemplateBinding FontSize}"
246246
Foreground="{TemplateBinding Foreground}"
247247
IsReadOnly="{TemplateBinding IsReadOnly}"
248-
Style="{StaticResource DefaultComboBoxTextBoxStyle}" />
248+
Style="{StaticResource DefaultComboBoxTextBoxStyle}"
249+
AutomationProperties.Name="{TemplateBinding AutomationProperties.Name}" />
249250
</Grid>
250251
</Grid>
251252
<Popup

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/DatePicker.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
<Setter Property="VerticalContentAlignment" Value="Stretch" />
3131
<Setter Property="BorderBrush" Value="Transparent" />
3232
<Setter Property="Background" Value="Transparent" />
33+
<Setter Property="AutomationProperties.Name" Value="{Binding Path=(AutomationProperties.Name), Mode=OneWay, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type DatePicker}}}" />
3334
<Setter Property="Foreground">
3435
<Setter.Value>
3536
<SolidColorBrush Color="{DynamicResource TextFillColorPrimary}" />
@@ -133,6 +134,7 @@
133134
VerticalContentAlignment="Center"
134135
Background="Transparent"
135136
BorderBrush="Transparent"
137+
AutomationProperties.Name="{Binding Path=(AutomationProperties.Name), Mode=OneWay, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type DatePicker}}}"
136138
Cursor="Arrow">
137139
<!-- WPF overrides paddings for button -->
138140

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/ScrollBar.xaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@
139139
Command="ScrollBar.LineUpCommand"
140140
Content="{StaticResource CaretUpGlyph}"
141141
Opacity="0"
142+
AutomationProperties.Name="Scroll Up"
142143
Style="{StaticResource ScrollBarLineButtonStyle}" />
143144
<Track
144145
x:Name="PART_Track"
@@ -168,6 +169,7 @@
168169
Command="ScrollBar.LineDownCommand"
169170
Content="{StaticResource CaretDownGlyph}"
170171
Opacity="0"
172+
AutomationProperties.Name="Scroll Down"
171173
Style="{StaticResource ScrollBarLineButtonStyle}" />
172174
</Grid>
173175
<ControlTemplate.Triggers>
@@ -259,6 +261,7 @@
259261
Command="ScrollBar.LineLeftCommand"
260262
Content="{StaticResource CaretLeftGlyph}"
261263
Opacity="0"
264+
AutomationProperties.Name="Scroll Left"
262265
Style="{StaticResource ScrollBarLineButtonStyle}" />
263266
<Track
264267
x:Name="PART_Track"
@@ -286,6 +289,7 @@
286289
Command="ScrollBar.LineRightCommand"
287290
Content="{StaticResource CaretRightGlyph}"
288291
Opacity="0"
292+
AutomationProperties.Name="Scroll Right"
289293
Style="{StaticResource ScrollBarLineButtonStyle}" />
290294
</Grid>
291295
<ControlTemplate.Triggers>

0 commit comments

Comments
 (0)