-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fixed AutomationProperties.Name for DatePicker Button #10949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fixed AutomationProperties.Name for DatePicker Button #10949
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes an accessibility issue by adding the missing AutomationProperties.Name attribute ("Show Calendar") to the DatePicker button.
- Updates the DatePicker button in all relevant theme files (Fluent, Fluent.Light, Fluent.HC, Fluent.Dark)
- Applies the same accessibility fix in the DatePicker.xaml style to improve compatibility with accessibility tools
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
Fluent.xaml | Added AutomationProperties.Name attribute to the DatePicker button |
Fluent.Light.xaml | Updated DatePicker button for consistent accessibility naming |
Fluent.HC.xaml | Fixed missing AutomationProperties.Name for accessibility compliance |
Fluent.Dark.xaml | Unified accessibility property update for DatePicker button |
DatePicker.xaml | Applied AutomationProperties.Name update in button style |
@@ -1803,7 +1803,7 @@ | |||
<Border x:Name="BorderElement" Grid.ColumnSpan="2" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="{TemplateBinding Border.CornerRadius}" MinHeight="32"> | |||
</Border> | |||
<DatePickerTextBox x:Name="PART_TextBox" Padding="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> | |||
<Button x:Name="PART_Button" Grid.Column="1" VerticalAlignment="Stretch" Style="{StaticResource CalendarButtonStyle}" Focusable="False" MinWidth="30"> | |||
<Button x:Name="PART_Button" Grid.Column="1" VerticalAlignment="Stretch" Style="{StaticResource CalendarButtonStyle}" AutomationProperties.Name="Show Calendar" Focusable="False" MinWidth="30"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider using a resource binding for the AutomationProperties.Name attribute to support localization, ensuring that accessibility text can be translated as needed.
Copilot uses AI. Check for mistakes.
@@ -2620,7 +2620,7 @@ | |||
<Border x:Name="BorderElement" Grid.ColumnSpan="2" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="{TemplateBinding Border.CornerRadius}" MinHeight="32"> | |||
</Border> | |||
<DatePickerTextBox x:Name="PART_TextBox" Padding="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> | |||
<Button x:Name="PART_Button" Grid.Column="1" VerticalAlignment="Stretch" Style="{StaticResource CalendarButtonStyle}" Focusable="False" MinWidth="30"> | |||
<Button x:Name="PART_Button" Grid.Column="1" VerticalAlignment="Stretch" Style="{StaticResource CalendarButtonStyle}" AutomationProperties.Name="Show Calendar" Focusable="False" MinWidth="30"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider using a resource binding for the AutomationProperties.Name attribute to support localization, ensuring that accessibility text can be translated as needed.
<Button x:Name="PART_Button" Grid.Column="1" VerticalAlignment="Stretch" Style="{StaticResource CalendarButtonStyle}" AutomationProperties.Name="Show Calendar" Focusable="False" MinWidth="30"> | |
<Button x:Name="PART_Button" Grid.Column="1" VerticalAlignment="Stretch" Style="{StaticResource CalendarButtonStyle}" AutomationProperties.Name="{DynamicResource DatePicker_ShowCalendar}" Focusable="False" MinWidth="30"> |
Copilot uses AI. Check for mistakes.
@@ -2505,7 +2505,7 @@ | |||
<Border x:Name="BorderElement" Grid.ColumnSpan="2" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="{TemplateBinding Border.CornerRadius}" MinHeight="32"> | |||
</Border> | |||
<DatePickerTextBox x:Name="PART_TextBox" Padding="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> | |||
<Button x:Name="PART_Button" Grid.Column="1" VerticalAlignment="Stretch" Style="{StaticResource CalendarButtonStyle}" Focusable="False" MinWidth="30"> | |||
<Button x:Name="PART_Button" Grid.Column="1" VerticalAlignment="Stretch" Style="{StaticResource CalendarButtonStyle}" AutomationProperties.Name="Show Calendar" Focusable="False" MinWidth="30"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider using a resource binding for the AutomationProperties.Name attribute to support localization, ensuring that accessibility text can be translated as needed.
<Button x:Name="PART_Button" Grid.Column="1" VerticalAlignment="Stretch" Style="{StaticResource CalendarButtonStyle}" AutomationProperties.Name="Show Calendar" Focusable="False" MinWidth="30"> | |
<Button x:Name="PART_Button" Grid.Column="1" VerticalAlignment="Stretch" Style="{StaticResource CalendarButtonStyle}" AutomationProperties.Name="{DynamicResource DatePicker_ShowCalendar}" Focusable="False" MinWidth="30"> |
Copilot uses AI. Check for mistakes.
@@ -2605,7 +2605,7 @@ | |||
<Border x:Name="BorderElement" Grid.ColumnSpan="2" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="{TemplateBinding Border.CornerRadius}" MinHeight="32"> | |||
</Border> | |||
<DatePickerTextBox x:Name="PART_TextBox" Padding="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> | |||
<Button x:Name="PART_Button" Grid.Column="1" VerticalAlignment="Stretch" Style="{StaticResource CalendarButtonStyle}" Focusable="False" MinWidth="30"> | |||
<Button x:Name="PART_Button" Grid.Column="1" VerticalAlignment="Stretch" Style="{StaticResource CalendarButtonStyle}" AutomationProperties.Name="Show Calendar" Focusable="False" MinWidth="30"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider using a resource binding for the AutomationProperties.Name attribute to support localization, ensuring that accessibility text can be translated as needed.
<Button x:Name="PART_Button" Grid.Column="1" VerticalAlignment="Stretch" Style="{StaticResource CalendarButtonStyle}" AutomationProperties.Name="Show Calendar" Focusable="False" MinWidth="30"> | |
<Button x:Name="PART_Button" Grid.Column="1" VerticalAlignment="Stretch" Style="{StaticResource CalendarButtonStyle}" AutomationProperties.Name="{DynamicResource DatePickerShowCalendarText}" Focusable="False" MinWidth="30"> |
Copilot uses AI. Check for mistakes.
@@ -196,6 +196,7 @@ | |||
Grid.Column="1" | |||
VerticalAlignment="Stretch" | |||
Style="{StaticResource CalendarButtonStyle}" | |||
AutomationProperties.Name="Show Calendar" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider using a resource binding for the AutomationProperties.Name attribute here as well to support localization, ensuring accessibility text is maintained across cultures.
Copilot uses AI. Check for mistakes.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #10949 +/- ##
===================================================
+ Coverage 2.98754% 13.36679% +10.37924%
===================================================
Files 3319 3319
Lines 664894 664894
Branches 74674 74674
===================================================
+ Hits 19864 88875 +69011
+ Misses 644849 573479 -71370
- Partials 181 2540 +2359
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Description
The "Show Calendar" button for DatePicker control did not have any name set to it, which causes issues for users using Accessibility Features in Windows.
Customer Impact
Customers using Accessibility Features in Windows, like Narrator, etc. will be able to use the control with ease.
Regression
No
Testing
Local app + Narrator testing
Risk
Minimal
Microsoft Reviewers: Open in CodeFlow