More accessibility improvements #1480
Open
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.
QA: https://deploy-preview-1480--ia-bookreader.netlify.app/bookreaderdemo/demo-internetarchive?ocaid=theworksofplato01platiala#page/198/mode/2up
Fixes 3 points from the audit:
role=slideraria-expanded; will include once it's merged: Add aria-expanded to BR sidebar menus iaux-item-navigator#24And a few other small points:
A few considerations:
Introduce an odd experience where the keyboard shortcuts when the slider has focus are different than the shortcuts when it doesn't. Without focus, left/right goes back/forward, and up/down goes back/forward, and pgup/pgdown move by a single page. But since the slider is now handling its keyboard shortcuts, up/down move in the opposite direction, and pgup/pgdown move in jumps. Note sure which is better here, but I think it could be confusing if a user click the slider, is then given focus, and then the keyboard shortcuts change.jumpToIndexmethod to take an optionalariaLiveparameter so that we can decide in what contexts we do indeed want the new page to be announced. Otherwise the page change was announced/interrupted the read aloud experience, and also was duplicated when using the slider. This resulted in a bigger refactor with a BREAKING CHANGE to thejumpToIndexmethod's interface, from:BookReader.jumpToIndex(index: PageIndex, pageX = 0, pageY = 0, noAnimate = false)toBookReader.jumpToIndex(indexOrDirection: PageIndex | 'left' | 'right' | 'next' | 'prev', {pageX = 0, pageY = 0, noAnimate = false, flipSpeed = null, ariaLive = false} = {}These other parameters weren't really functional / used, so I don't think it'll break any usecases.