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

feat(a11y): add option to change tabindex of month cells #1074

Closed
wants to merge 17 commits into from

Conversation

vandents
Copy link
Collaborator

@vandents vandents commented Aug 29, 2019

Discovered that we needed this option in our own application.

First a little background info on screen readers. Some screen readers (NVDA in particular) will begin to list off everything inside of a div/span if it has a tabindex, but no aria-label.

Currently, the tab index is always set on the mwl-calendar-month-cell component. In the default template this is fine, because the screen reader reads everything inside of the cell and there happens to be just one thing inside of the cell, an aria-label. Everything else in the cell is aria-hidden.

This becomes a problem when you have custom cell templates and want to have multiple things inside of them. A screen reader will get stopped at the tabindex of mwl-calendar-month-cell and may proceed to read off everything inside of the cell before you've tabbed to them.

This change allows you to turn off the tabindex of mwl-calendar-month-cell so you can manipulate your month cell more fully.

vandents and others added 17 commits August 5, 2019 14:41
BREAKING CHANGE: date-fns v2 or higher is now required as a peer dependency

If implementing a custom adapter, the `max` function signature has changed to accept an array of dates, instead of an infinite argument list.

The date adapters no longer accept strings as input arguments.

Closes mattlewis92#1064
BREAKING CHANGE: the dist files are no longer annotated for usage with closure compiler.
BREAKING CHANGE:

The day and week view have now merged. For most users this should be a seamless migration, however there are some edge cases that you may need to take account for:

Any custom styles you used for the day view will need to be adjusted. The `cal-day-view-theme` sass mixin is now gone as all the styles are shared between the week and day view.

The `eventWidth` option is removed, events now fill the available width.

If using `[daysInWeek]="1"` on the week view, the date and title formatters for the day view will be used instead.

The week view now has a border top applied to the top of the component container, rather than the top of the day headers container.

The `getDayView` and `getDayViewHourGrid` functions have been removed from the `CalendarUtils` service.

The following interfaces from `calendar-utils` were renamed: `DayViewHourSegment` -> `WeekViewHourSegment`, `DayViewHour` -> `WeekViewHour`, `DayViewEvent` -> `WeekViewTimeEvent`

The day view scheduler demo is now based off the week view instead, please check the updated demo code for how to migrate: https://mattlewis92.github.io/angular-calendar/#/day-view-scheduler

Closes mattlewis92#889
BREAKING CHANGE: the `columnHeaderClicked` output on the month view now exposes an object instead of just the ISO day number

Before:
```
columnHeaderClicked="columnHeaderClicked($event)"
```

After:
```
columnHeaderClicked="columnHeaderClicked($event.isoDayNumber)"
```

Closes mattlewis92#962
BREAKING CHANGE: if using a custom `headerTemplate` on the week view, then you must now add `let-dragEnter="dragEnter"` to the templates variables and `(dragEnter)="dragEnter.emit({ date: day.date })"` onto the `mwlDroppable` element.

Closes mattlewis92#1062
Merge Base 0.28 into Fork
@JaxonWright
Copy link
Collaborator

This fails a massive amount of tests for some reason. @mattlewis92 should this PR be closed and have the change be made directly to the main 0.28 branch to be included in PR #1070?

@mattlewis92
Copy link
Owner

Yeah, please base it off 0.28, you should just be able to cherry pick 71737ff across 😄

@vandents
Copy link
Collaborator Author

vandents commented Sep 3, 2019

@mattlewis92 just to confirm, 71737ff should be cherry-picked from volgistics:0.28 to mattlewis92:0.28 using Git CLI?

@mattlewis92
Copy link
Owner

@mattlewis92 just to confirm, 71737ff should be cherry-picked from volgistics:0.28 to mattlewis92:0.28 using Git CLI?

yes please! 😄

@mattlewis92 mattlewis92 force-pushed the 0.28 branch 3 times, most recently from ca0a0f8 to d0aaa83 Compare September 4, 2019 14:03
@mattlewis92
Copy link
Owner

Closing as it's now part of #1070 (I rebased it to merge all the a11y stuff into one commit)

@mattlewis92 mattlewis92 closed this Sep 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants