Skip to content

Commit 05fd3df

Browse files
committed
feat: add hint-text as AutomationProperty to the ComboBox by default so it can be picked up by a screen reader
1 parent 471110f commit 05fd3df

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/MainDemo.Wpf/Home.xaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@
5454
<TextBlock Margin="8,0,0,0" Text="EXPLORE" />
5555
</StackPanel>
5656
</Button>
57+
58+
<ComboBox materialDesign:HintAssist.Hint="Routing"
59+
Style="{StaticResource MaterialDesignFilledComboBox}"
60+
Width="400"/>
61+
5762
</StackPanel>
5863
</Grid>
5964

src/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.ComboBox.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,7 @@
884884
</ControlTemplate>
885885

886886
<Style x:Key="MaterialDesignComboBox" TargetType="{x:Type ComboBox}">
887+
<Setter Property="AutomationProperties.Name" Value="{Binding Path=(wpf:HintAssist.Hint), RelativeSource={RelativeSource Self}}" />
887888
<Setter Property="Background" Value="Transparent" />
888889
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesign.Brush.ComboBox.Border}" />
889890
<Setter Property="BorderThickness" Value="0,0,0,1" />

0 commit comments

Comments
 (0)