Repository navigation
[Calendar] Expose selected and disabled day states to assistive technologies - #5614
Merged
Denis Voituron (dvoituron) merged 2 commits intoNov 9, 2026
Merged
Conversation
Jeff (jeff377)
requested review from
Denis Voituron (dvoituron) and
Vincent Baaij (vnbaaij)
as code owners
November 9, 2026 12:46
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The tests do not exercise the new multi-day selection branch, leaving aria-pressed behavior for selected days, deselection, and range resets unverified.
1 open issue
What changed in this PR
This PR exposes selected and disabled day states in FluentCalendar to assistive technologies, addressing #5542 and #5543. FluentDatePicker inherits the same accessibility improvements.
Changes:
- Adds
aria-pressed="true"for selected days, including multi-day selections. - Preserves button semantics for disabled days and adds
aria-disabled="true", without changing tab order. - Updates nine snapshots; read-only calendars, inactive days, and month/year views remain unchanged.
| File | Description |
|---|---|
tests/Core/Components/DateTimes/FluentDatePickerTests.FluentDatePicker_Default.verified.razor.html |
Updates embedded calendar selected and disabled states. |
tests/Core/Components/DateTimes/FluentCalendarTests.FluentCalendar_WeekDaysTitle.verified.razor.html |
Adds selected-day pressed state. |
tests/Core/Components/DateTimes/FluentCalendarTests.FluentCalendar_WeekDays_French.verified.razor.html |
Adds pressed state in the French snapshot. |
tests/Core/Components/DateTimes/FluentCalendarTests.FluentCalendar_Title.verified.razor.html |
Updates selected-day markup. |
tests/Core/Components/DateTimes/FluentCalendarTests.FluentCalendar_Title_ByCulture-fa-IR.verified.razor.html |
Adds pressed state in the Persian-calendar snapshot. |
tests/Core/Components/DateTimes/FluentCalendarTests.FluentCalendar_Title_ByCulture-en-US.verified.razor.html |
Adds pressed state in the US-English snapshot. |
tests/Core/Components/DateTimes/FluentCalendarTests.FluentCalendar_MinMax.verified.razor.html |
Updates disabled boundary dates and selected-day state. |
tests/Core/Components/DateTimes/FluentCalendarTests.FluentCalendar_Minimum_View-days.verified.razor.html |
Adds pressed state in the minimum-date snapshot. |
tests/Core/Components/DateTimes/FluentCalendarTests.FluentCalendar_Default.verified.razor.html |
Updates default selected and disabled day markup. |
src/Core/Components/DateTime/FluentCalendar.razor |
Exposes day selection and disabled states through ARIA attributes. |
Review effort: Balanced
Denis Voituron (dvoituron)
approved these changes
Nov 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Pull Request
📖 Description
Screen readers did not announce the state of days in
FluentCalendar:role="button"but no attribute exposing the selected state ([FluentCalendar]: Screen reader does not announce the selected state for the selected date in the Calendar #5542).roleremoved, so it was exposed as a plaingenericelement with no state ([FluentCalendar]: Screen reader does not announce the disabled state for disabled dates in the Calendar #5543).This PR changes the day element in
FluentCalendar.razor:aria-pressed="true".role="button"and getaria-disabled="true". They still have notabindex, so keyboard navigation does not change.There is no visual change.
FluentDatePickeruses the same calendar, so it gets the same fix.As proposed in the issue, this PR:
aria-pressedrather thanaria-selected, becausearia-selectedisn't allowed onrole="button". Screen readers announce "pressed" rather than "selected". Announcing "selected" would require agrid/gridcellstructure, which is a larger change.Type: fix (accessibility), not a breaking change.
🎫 Issues
Fixes #5542
Fixes #5543
The approach was proposed in #5542 (comment) (and linked from #5543), and agreed in the maintainer reply that follows it.
👩💻 Reviewer Notes
FluentCalendar.razor. The other files are snapshot updates.Before (
dev):After:
In the Chrome accessibility tree, the days change from
generic "November 3"andbutton "November 9"(no states) tobutton "November 3"(disabled) andbutton "November 9"(pressed).📑 Test Plan
FluentCalendarandFluentDatePickertests. I compared each.receivedfile with its.verifiedfile: the only differences are the newrole,aria-disabled, andaria-pressedattributes.FluentCalendar_SelectMode_Multiple_SelectedDaysArePressedandFluentCalendar_SelectMode_Range_SelectedDaysArePressed: every selected day hasaria-pressed="true", other days don't, and the attribute is removed after unselecting a day or resetting a range. Both tests fail without the component change, and also fail if the multi-day branch is removed.tests/Core/Components.Tests.csprojsuite locally on macOS: all 5261 tests passed.Microsoft.FluentUI-v5.slnxwith no warnings or errors.✅ Checklist
General
Issue discussion declaration
Discuss changes before implementing them to confirm that the problem and proposed approach fit the project. See Discuss before implementing for the process and exceptions.
AI contribution declaration
AI assistance is allowed; fully AI-generated or autonomous pull requests without meaningful human review are not accepted. See the AI contribution policy.
Component-specific
⏭ Next Steps
If you'd like, I can apply the same change to the month and year views in a follow-up PR.