-
Notifications
You must be signed in to change notification settings - Fork 116
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
fix(ThumbnailsSidebar): A11Y - add aria-current to ThumbnailsSidebar #1417
fix(ThumbnailsSidebar): A11Y - add aria-current to ThumbnailsSidebar #1417
Conversation
@@ -254,6 +254,7 @@ class ThumbnailsSidebar { | |||
|
|||
if (pageNum === this.currentPage) { | |||
thumbnailEl.classList.add(CLASS_BOX_PREVIEW_THUMBNAIL_IS_SELECTED); | |||
thumbnailEl.setAttribute('aria-current', true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this value get updated as the user changes between pages?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jstoffan you are right. I added and removed the aria-current when user changes between pages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add tests, please?
@jstoffan I just added an unit test |
|
||
thumbnailsSidebar.applyCurrentPageSelection(); | ||
|
||
expect(stubs.addAriaAttribute).toBeCalledTimes(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add an assertion for the removeAttribute
call, as well, similar to the tests above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jstoffan I just added another unit test case.
There is a visual indication of the current thumbnail that also presents the current page You should convey this information to screen reader with aria-current="true". For example: