Skip to content
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

This PR fixes ADA screen reader issues for days outside the current month in the calendar. #885

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions lib/src/table_calendar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,6 @@ class _TableCalendarState<T> extends State<TableCalendar<T>> {
}

void _onDayTapped(DateTime day) {
final isOutside = day.month != _focusedDay.value.month;
if (isOutside && _shouldBlockOutsideDays) {
return;
}

if (_isDayDisabled(day)) {
return widget.onDisabledDayTapped?.call(day);
Expand All @@ -374,10 +370,6 @@ class _TableCalendarState<T> extends State<TableCalendar<T>> {
}

void _onDayLongPressed(DateTime day) {
final isOutside = day.month != _focusedDay.value.month;
if (isOutside && _shouldBlockOutsideDays) {
return;
}

if (_isDayDisabled(day)) {
return widget.onDisabledDayLongPressed?.call(day);
Expand Down Expand Up @@ -556,6 +548,11 @@ class _TableCalendarState<T> extends State<TableCalendar<T>> {
return dowCell;
},
dayBuilder: (context, day, focusedMonth) {
final isOutside = day.month != focusedMonth.month;

if (isOutside && _shouldBlockOutsideDays) {
return Container();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion : use SizedBox.shrink() instead of Container();

}
return GestureDetector(
behavior: widget.dayHitTestBehavior,
onTap: () => _onDayTapped(day),
Expand All @@ -572,10 +569,6 @@ class _TableCalendarState<T> extends State<TableCalendar<T>> {
Widget _buildCell(DateTime day, DateTime focusedDay) {
final isOutside = day.month != focusedDay.month;

if (isOutside && _shouldBlockOutsideDays) {
return Container();
}

return LayoutBuilder(
builder: (context, constraints) {
final shorterSide = constraints.maxHeight > constraints.maxWidth
Expand Down