diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Inputs/Calendar/BitCalendar.razor b/src/BlazorUI/Bit.BlazorUI/Components/Inputs/Calendar/BitCalendar.razor index 9a5c9b2fb3b..808082b1733 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Inputs/Calendar/BitCalendar.razor +++ b/src/BlazorUI/Bit.BlazorUI/Components/Inputs/Calendar/BitCalendar.razor @@ -6,6 +6,7 @@ var todayYear = _culture.Calendar.GetYear(today); var todayMonth = _culture.Calendar.GetMonth(today); var focusableDay = GetFocusableDay(); + var isInvalid = ValueInvalid is true; var prevMonthNavIconCss = BitIconInfo.From(PrevMonthNavIcon, PrevMonthNavIconName ?? "Up")?.GetCssClasses(); var nextMonthNavIconCss = BitIconInfo.From(NextMonthNavIcon, NextMonthNavIconName ?? "Up bit-ico-r180")?.GetCssClasses(); @@ -23,200 +24,260 @@ var decreaseMinuteIconCss = BitIconInfo.From(TimePickerDecreaseMinuteIcon, TimePickerDecreaseMinuteIconName ?? "ChevronDownSmall")?.GetCssClasses(); } +@* A calendar is a composite of labelled grids, so it needs no role of its own - but one given a name is a + named group, which is what lets a screen reader say which of two calendars on a page the focus is in. *@
-
+ @if (HeaderTemplate is not null) + { +
@HeaderTemplate
+ } + +
+ @* The selection as words, for a screen reader alone: the day cell carries it as aria-selected, which + is state rather than something announced when it changes. Left empty while nothing is selected, so + clearing the value does not announce a selection of nothing. *@
- @(string.Format(SelectedDateAriaAtomic, CurrentValueAsString)) + @(CurrentValueAsString.HasValue() ? string.Format(SelectedDateAriaAtomic, CurrentValueAsString) : null)
@if (DayPickerIsVisible()) { -
-
- @if (ShowMonthPicker && (ShowMonthPickerAsOverlay || (ShowTimePicker && ShowTimePickerAsOverlay is false))) - { - var title = string.Format(MonthPickerToggleTitle, _monthTitle); - - } - else - { -
- @_monthTitle -
- } - @{ - var prevDisabled = CanChangeMonth(false) is false; - var nextDisabled = CanChangeMonth(true) is false; - } -
-