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

Calendar Accessibility: Prevent VoiceOver Calendar Scrollback #17761

Merged

Conversation

joshheald
Copy link
Contributor

@joshheald joshheald commented Jan 14, 2022

Fixes #17760

Description

Previously, when moving VoiceOver focus from the next button to the Date Cells on the Schedule Post popover, the calendar would scroll back to 1 Jan 1951.

This automated scrollback is a probably-intentional part of UICollectionView (to enable VoiceOver to read everything in a collection view) but it is not appropriate in its use here as a calendar.

This change prevents that automated scrollback, and only makes any change when the relevant accessibility features are in use.

The same issue happened sporadically on the year view calendar; I wasn't able to find repro steps for that, but this change should improve the behaviour there as well.

To test:

On the Schedule Post screen:

  1. Open the calendar with VoiceOver enabled
  2. Swipe left repeatedly until you get to a date cell
  3. Observe that the first date cell you reach is the first visible cell, rather than 1 Jan 1951

Screenshots

VoiceOver.calendar.scrollback.fixed.mp4

Regression Notes

  1. Potential unintended areas of impact
    General use of the calendar should be unaffected; the UIAccessibility.isVoiceOverRunning check which gates the changes will prevent issues when VoiceOver is not in use.
    Anywhere which scrolls the calendar automatically should be tested carefully. The Next/Previous Month buttons are examples of those, and other possibilities are layout changes, e.g. portrait/landscape, iPad size class changes.

Note that even without these changes, the calendar does not respond well to layout changes (the months stop fitting on the screen).

Also note, I do not have a physical iPad to test these changes on, so they have only been tested on a physical phone and an iPad simulator. To test on an iPad simulator, I had to change the condition in CalendarCollectionView.shouldPreventAccessibilityFocusScrollback(for:) to be if UIAccessibility.isVoiceOverRunning || UIDevice.isPad() and use the Accessibility Inspector to move between elements, as the Inspector does not count as voiceover.

The calendar is used both on the Activity Log date filter, and the Schedule Post date selector.

  1. What I did to test those areas of impact (or what existing automated tests I relied on)
    Extensive VoiceOver and Switch Control use of the calendar

  2. What automated tests I added (or what prevented me from doing so)
    None

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding unit tests for my changes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Jan 14, 2022

You can trigger an installable build for these changes by visiting CircleCI here.

@joshheald joshheald marked this pull request as draft January 14, 2022 07:04
Previously, when moving VoiceOver focus from the next button to the Date Cells on the Schedule Post popover, the calendar would scroll back to 1 Jan 1951.

This automated scrollback is a probably-intentional part of UICollectionView (to enable VoiceOver to read everything in a collection view) but it is not appropriate in its use here as a calendar.

This change prevents that automated scrollback, and only makes any change when the relevant accessibility features are in use.

The same issue happened sporadically on the year view calendar; I wasn't able to find repro steps for that, but this change should improve the behaviour there as well.
@joshheald joshheald force-pushed the issue/17760-prevent-voiceover-calendar-scrollback branch from 30b9ff3 to 78675a3 Compare January 14, 2022 07:05
@joshheald joshheald self-assigned this Jan 14, 2022
@joshheald joshheald added this to the 19.1 milestone Jan 14, 2022
@joshheald joshheald changed the base branch from develop to issue/15722-custom-calendar-accessibility-improvements January 14, 2022 07:17
@joshheald joshheald marked this pull request as ready for review January 14, 2022 07:18
@peril-wordpress-mobile
Copy link

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

Base automatically changed from issue/15722-custom-calendar-accessibility-improvements to develop January 14, 2022 10:01
Copy link
Contributor

@momo-ozawa momo-ozawa left a comment

Choose a reason for hiding this comment

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

Works as described! Tested on a real iPad. :)

@joshheald joshheald merged commit 87fa323 into develop Jan 14, 2022
@joshheald joshheald deleted the issue/17760-prevent-voiceover-calendar-scrollback branch January 14, 2022 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calendar accessibility: Navigating to the first visible date button on the Schedule Post view, not 1 Jan 1951
2 participants