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

Image Carousel Example: Use buttons for controls and make rotation control always visible #1018

Merged
merged 27 commits into from
Jul 11, 2019

Conversation

jongund
Copy link
Contributor

@jongund jongund commented Apr 16, 2019

Resolves issue #1007 by making the stop/start rotation button always visible and uses button elements instead of links for the next and previous slide elements.

Preview Link

The revised carousel can be seen in the issue1007-visible-pause-carousel branch.


Preview | Diff

@mcking65 mcking65 self-assigned this Apr 23, 2019
@mcking65 mcking65 changed the title Issue1007 visible pause on carousel example Image Carousel Example: Use buttons for controls and make rotation control always visible Apr 23, 2019
@jnurthen jnurthen self-requested a review April 23, 2019 18:26
@charmarkk charmarkk requested a review from a11ydoer April 23, 2019 18:27
@css-meeting-bot
Copy link
Member

The ARIA Authoring Practices (APG) Task Force just discussed Reviewers needed for revised carousel.

The full IRC log of that discussion <AnnAbbott> TOPIC: Reviewers needed for revised carousel
<AnnAbbott> PR 1018: https://github.com//pull/1018
<zcorpan> GitHub: https://github.com//pull/1018
<AnnAbbott> mck: issues for Windows, Mac & iOS
<jongund> https://raw.githack.com/w3c/aria-practices/issue1007-visible-pause-carousel/examples/carousel/carousel-1/carousel-1.html
<AnnAbbott> mck: goal is fully reviewed by May 7 and ready to merge
<MarkMcCarthy> I cannot volunteer at that this time, we have several all hands projects tying me up. Sorry!
<AnnAbbott> Jemma volunteered
<AnnAbbott> jn volunteered
<AnnAbbott> mck: other issues should go into 971

@carmacleod
Copy link
Contributor

carmacleod commented May 28, 2019

Please note this issue comment re: size: #971 (comment)

Copy link
Contributor

@spectranaut spectranaut left a comment

Choose a reason for hiding this comment

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

I left some commons in a test file! If it's ok, I'm going to follow up with a commit to fix it to help out.

test/tests/carousel-1.js Show resolved Hide resolved
test/tests/carousel-1.js Outdated Show resolved Hide resolved
test/tests/carousel-1.js Outdated Show resolved Hide resolved
@spectranaut
Copy link
Contributor

spectranaut commented Jul 1, 2019

hey @jongund! I added a commit to fix up the existing attribute tests. I also added a couple tests and have two observations:

I noticed a bug with aria-live. The table description does not match the behavoir. aria-live is set to off on page load, but after interacting with the widget in any way (hovering mouse, moving focus), aria-level is set to polite and it remains that way after focus leaves the widget and the automatic transitions begin again. Unless you click pause, in which case it changes to off (which seems to be incorrect according to the table, which states The live region is off when the carousel is automatically rotating.). The test for aria-live is failing as it test what is described in the table.

You also might notice the test I wrote for aria-disabled is failing as well. Using selenium test driver, I'm having trouble replicating moving the focus from the "previous" button to the "pause" button (which should remove aria-disabled according to the table) -- I'm not sure if this is a bug in the example, but I can look into it tomorrow morning. Writing this test made me think that the use of aria-disabled here could be confusing, as the button will always work if you navigate to it or click it. Specifically, the button will turn off the automatic rotation off once you leave the carousel region regardless of whether the automatic transition is currently happen. Maybe there is something more to "aria-disabled" than I realize, but is it really necessary for this widget?

@jongund
Copy link
Contributor Author

jongund commented Jul 2, 2019

@spectranaut I will look into the aria-live issue, it should be pretty easy to fix

The aria-disabled is used instead of disable property so the button stays in tab order for screen reader users. When focus is in the carousel the carousel automatically pauses, so the pause button is essentially disabled.

@spectranaut
Copy link
Contributor

Ok I added more tests for keyboard interaction, and I notice the Keyboard Interaction table needs to be updated now that the "pause" button no longer hides. Other than that it looks good :)

@mcking65
Copy link
Contributor

mcking65 commented Jul 2, 2019

@jongund wrote:

@spectranaut I will look into the aria-live issue, it should be pretty easy to fix

Excellent, thank you! Since we never want it live when auto-rotating, can the change of aria-live be triggered based on changes to the auto-rotation state regardless of which user event causes rotation to stop or start?

The aria-disabled is used instead of disable property so the button stays in tab order for screen reader users. When focus is in the carousel the carousel automatically pauses, so the pause button is essentially disabled.

After discussing with Valerie and Jemma, we concluded that we can remove aria-disabled because, in practice, the button is never disabled. It is still operable with the mouse, screen reader reading cursor, or touch cursor even when rotation is paused automatically. And, it is useful to be able to click or tap it even when automatically paused; that causes the carousel to stay stopped.

@jongund
Copy link
Contributor Author

jongund commented Jul 3, 2019

@spectranaut Thank you for adding the regression tests I will make the changes for disabled button and the live region

@jongund
Copy link
Contributor Author

jongund commented Jul 3, 2019

@spectranaut @mcking65 @a11ydoer I made the changes to the code to fix the live region issue, so it is ready for review and hopefully merging and I also removed the aria-disabled attribute to the "Pause" button.

Copy link
Contributor

@mcking65 mcking65 left a comment

Choose a reason for hiding this comment

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

@jongund, thank you; this is looking really good. I fixed some editorial issues. It's ready to go now.

There is one thing we can address later: the view options are not accessible; we need to put aria-current on the link that is currently active. We don't need to hold this up for that though.

@mcking65 mcking65 merged commit 0ba3c1c into master Jul 11, 2019
@mcking65 mcking65 deleted the issue1007-visible-pause-carousel branch July 11, 2019 07:10
michael-n-cooper pushed a commit that referenced this pull request Jul 11, 2019
Image Carousel Example: Use buttons for controls and make rotation control always visible (pull #1018)

Resolves issue #1007 by:
* making the stop/start rotation button always visible.
* Using button elements instead of links for the next and previous slide controls.

Also:
* Allows user to change between 2 view options: one with controls and captions overlayed on the images and one with them outside the image frames.
* Improves documentation in the accessibility features section.
* Adds regression tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants