-
Notifications
You must be signed in to change notification settings - Fork 1k
Add InternalRaiseAutomationNotification in WmDateChanged of the MonthCalendar #13707
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?
Add InternalRaiseAutomationNotification in WmDateChanged of the MonthCalendar #13707
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #13707 +/- ##
===================================================
+ Coverage 76.82947% 76.90768% +0.07820%
===================================================
Files 3257 3260 +3
Lines 642592 643097 +505
Branches 47565 47601 +36
===================================================
+ Hits 493700 494591 +891
+ Misses 145232 144836 -396
- Partials 3660 3670 +10
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
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 enhances accessibility support for the MonthCalendar control by adding automation notifications when the selected date changes. The change ensures that screen readers like NVDA can properly announce date changes when users navigate the calendar with keyboard inputs.
Key changes:
- Adds automation notification calls in the WmDateChanged method to notify accessibility tools when calendar focus/selection changes
- Introduces a new app context switch to control this behavior
- Uses both legacy MSAA events and modern UIA notifications for broader compatibility
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
MonthCalendar.cs | Adds automation notification logic in WmDateChanged method with app context switch guard |
LocalAppContextSwitches.cs | Defines new app context switch for enabling MonthCalendar automation notifications |
Comments suppressed due to low confidence (1)
src/System.Windows.Forms.Primitives/src/System/LocalAppContextSwitches/LocalAppContextSwitches.cs:29
- The switch name contains 'RichTextBox' but should reference 'MonthCalendar' since this switch is for MonthCalendar automation notifications. It should be 'System.Windows.Forms.MonthCalendar.EnableMonthCalendarAutomationNotification'.
internal const string EnableMonthCalendarAutomationNotificationSwitchName = "System.Windows.Forms.RichTextBox.EnableMonthCalendarAutomationNotification";
...ystem.Windows.Forms.Primitives/src/System/LocalAppContextSwitches/LocalAppContextSwitches.cs
Outdated
Show resolved
Hide resolved
…Switches/LocalAppContextSwitches.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
fa2437f
to
728b2c6
Compare
@merriemcgaw Regarding this PR, I need to correct a mistake Turning on the existing switch I updated the PR, adding MSAA events to MonthCalendar while retaining the original UIA events, so that both tools can read cell content normally, please review again |
Fixes #13657
Proposed changes
WmDateChanged
of theMonthCalendar
so that the MonthCalendar remains in the Focused state when switching dates with the keyboardCustomer Impact
Regression?
Risk
Screenshots
Before
NVDA cannot announce the correct information for the calendar date
Bug_13657_A11y_WinForms.NETRuntime_CommonControl2_InfoAndRelationships.mp4
After
The calendar date can be announced and the
MonthCalendar
can be focused with NVDANVDA-2024.4.2.mp4
Test methodology
Test environment(s)
Microsoft Reviewers: Open in CodeFlow