-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
accessible slick as tablist widget #2119
Conversation
+ `aria-label` not needed where button text content reads as we want screen readers to read + `tabindex` not needed since button element is able to receive focus by default + `role` not needed if intended role matches default of element
+ `aria-required` is not needed here; helpful more on, e.g., input fields that are required
…mentation of tabpanel
…essible tabpanel UI pattern
…rol / tab in initADA
account for instances of slick where slide to dot mapping is not 1-1
I was writing the same solution untill I saw this Pull Request Nice fix! :) |
thanks @sboerjan :) please shout any thoughts / ideas you have -- would love to know what implementation details feel sound to other devs / users. |
Nice work @cielt !! I was about to start writing a solution for the slick-dots and I found your PR. I hope this will be included very soon on the next version. |
@marcoborsoi: great -- encouraged to know that you were thinking along these lines. would love to hear any further suggestions that may occur to you as we figure out these design patterns. cheers! |
I was going through slick and planning to make a PR with many of the same edits. Glad to see it's already being suggested! Nice work here |
thanks, @scottaohara! please shout if any thoughts / suggestions :) |
This is great. How can I toggle these accessible features on and off for specific sliders? Currently it affects all the sliders I initialise. |
@Gofilord why would you want a slider to be inaccessible? |
@Gofilord: ⬆️ i was wondering that too ;) but, fair enough, since it is an option ... have you tried including |
@scottaohara Sometimes this accessibility PR creates issues. For me - I had an auto sliding gallery at the top of the page. When I scrolled down and a new slide moved it, the whole page jumped up to where the slider is. I couldn't fix it, and it only happened with this upgraded accessibility slider; not with the standard one. @cielt I have tried setting the accessibility to false, but it didn't help. However, I have found a solution: I know it's not very efficient because you have to include a library twice, but it fixes the jumping. |
@Gofilord: i understand your issue now, and appreciate that one would not want all of these accessibility features 'on' across the board in this case. i'm not sure that i have a good solution yet, but in case it helps i'll offer my rationale for having done things as i have, and try to explain what's going on: re the page jumping to the auto sliding instance when its current slide changes: if that said, if one has a carousel on autoplay, and configured to behave thus ( arguably, a carousel on autoplay is inherently not accessible -- since the user does not have full control over the interaction, and it is hard to communicate the continually updating content in a non-intrusive manner to screen reader users. i revisited this article on the challenges of making carousels accessible and am struck by a number of requirements not yet covered in this work. some of this accessibility (e.g., button size, slick dots coming ahead of slides in HTML) involves style and markup decisions that are best left to those implementing a specific instance in a given context but it would be good to provide a foundation in the plugin that enables as much accessibility as possible (thinking about how to handle this given the scope of work here ...). in response to your question, specifically -- about how to fix the page jump issue -- i would refine my earlier note and ask, have you tried setting change the setting, and you'll experience that jump issue you described. this is an important caveat for this setting here and bears highlighting -- appreciate your calling attention to it. trying to work out how far to go with this (e.g., should accessibility be overridden by default if autoplay is true? should any questions / suggestions please let me know. thanks! |
@cielt Thanks for the elaborate explanation and all the help. |
Hi all, many thanks for the work & input here(!) Apologies for my delay in getting to much of this feedback. In order, roughly, re what's new to me ... @jasonday: the mechanics of selection and navigation are based on what i've read and understood to be conventions for this kind of UI component. i have no doubt that there is room to improve on the @janwidmer @scottaohara: re slick behavior where @Gofilord @leggomuhgreggo: re the problematic jump, where an As suggested by @scottaohara even better to disable the autoplay where carousels are not on the page (for non-sighted and sighted users alike) but it does get tricky knowing when to re-activate for the screenreader (autoplay!). Sounds like handling this would make for a solid future PR? @leggomuhgreggo @scottaohara: i noted that the changes in master were merged in for a reason and didn't want to undo here, but your points are well taken. As i understand it, TODOs include
Thanks! |
@scottaohara I definitely see the logic in having a button to add that autoplay control, but I'm apprehensive about additional elements because it adds complexity to the API (enable bool, etc.), and risks a more heavily opinionated structure to contend with. I actually like the idea, the more I think about it, but I think it'd need to be hidden except for screen readers by default and probably should be it's own PR, subsequent to this one. To me, the simplest (and ideal for the short term) solution would be to simply disable the focus when The alternative of having a check to see if the slider is offscreen probably a little bit closer to satisfying all use cases, but I think it'd be hard to find an elegant way to do that, and I feel like "why add the additional complexity, when autoplay isn't exactly compliant in the first place." @cielt Thanks for the bang up job regrouping on this! We're fixin to release 1.7.0 soon. I'd love to get the tabbed widget enhancement in there. I think at a minimum it needs to have a "focus jump" solution and solid testing to make sure tabbing and focusing are working as expected. Definitely not out of the question :) Thanks! |
* for current showing slide (group), allow first child to be focussable * where autoplay === false, set browser focus to first newly showing slide after slide change * rename var for better clarity
@cielt nice! Here're some test cases using this branch. And here're the tests using the current master if there's any question of an issue being related to this PR. I went through quickly and didn't notice anything, but it'd be awesome if someone with more a11y expertise could go through and make sure things are working as expected. Thanks! |
@leggomuhgreggo thanks for this! 👍 will have a close look myself as soon as i can (realistically, in a day or 2) and make sure it holds solidly through allthecases. will also seek to get more feedback -- especially re the screenreader UX. carousels are often decried for being at odds with accessible UX but the goal here is to remove barriers where we can, and layer on some semantic cues and predictability in behavior that will improve access for all users, especially those relying on assistive technologies. i'm sure you're aware, but wanted to highlight some challenges here, stemming from:
Both open questions bear further discussion but, in the absence of authoritative and complete precedents, here's what i'm thinking in my approach to this:
Will do some testing and let you know what i find out. Thanks! |
Dope! Really appreciate your helping lead these efforts @cielt. Pumped to hear how things go. Thanks! |
I'll jump in and do some testing across a few different devices &
screenreaders and report back. I believe I tested my original pull request
in NVDA/Firefox, Window Eyes/IE, and Voiceover/Safari (ipad). I don't have
JAWS currently, so it would be great if someone could help out there.
…On Mon, Jun 19, 2017 at 4:14 PM, leggomuhgreggo ***@***.***> wrote:
Dope! Really appreciate your helping lead these efforts @cielt
<https://github.com/cielt>. Pumped to hear how things go.
Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2119 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAtp67_AqWQ2Ydqsx7fsJx_EETlem9Ltks5sFta4gaJpZM4HZZwI>
.
|
huzzah -- thanks @jasonday! 👏 will see if i can track down some help with JAWS. |
Just checkin in. Squeaky wheel gets the oil, yada yada |
Always has 🛢️ Apologies, it's been a minute. Only small updates as yet:
All i got at the moment. It may be some time so, for your planning purposes, getting answers soon seems optimistic. But seems important to verify that these changes are actually on the right track for a11y. Thanks for touching base! |
@cielt I tested this in NVDA/Firefox, JAWS/IE as well as VoiceOver and personally I find it much more useable compared to the demo carousels on the main site. Perhaps the single most important fix is the removal of aria-live from the container. My experience with this carousel is it's gets too noisey and conflicts with parent containers with aria-live already present. My recommendations (and anyone feel free to add):
Great work! Hopefully this will be merged. |
…ole=tabpanel] rather than first child of slide
@miconley: thanks a million for the feedback & SR testing assist! The removal of Couple of updates:
Please lmk if any questions / suggestions. Thanks! |
@cielt dude nice work! You think this is good for a merge? |
@leggomuhgreggo: just wanted to add a brief update to the README. Will gladly hear out concerns / suggestions from anyone who's got them, but here's the current final snapshot of what i'm proposing. Thanks! |
@cielt helll yeee. Did some testing. Looks good. Merged. Will get the release out soon. Thanks to everyone who helped with this enhancement! |
Excellent, @leggomuhgreggo! Echoing thanks to all here for your suggestions & help with this! 👏👏 |
So awesome to see this, great work @cielt 🍻 |
Thanks for the great work.. any idea, if those changes will land in a release prior to 2.0? |
@janwidmer it will be in a release that's coming out in the next couple days |
Hey.. They mentioned two things which could get improved:
@miconley did you also notice these "problems" when testing? |
@janwidmer: Very good to know. Thanks so much for putting the current build to the test with true a11y specialists -- and following up! I can appreciate that Would be very interested to hear what folks think. i do not see any open PRs proposing feature:a11y updates at the moment but if this sounds like a solid way forward, would encourage creating one. Thanks! |
@cielt of course the contributors have made their best effort and that's really nice. The current state is already a massive improvement regarding a11y. I would also be interested in other folks thoughts since the whole a11y topic is sometimes very subjective.. |
the proposed changes here re-work the accessible slick carousel as an implementation of the aria tabpanel widget (note: this applies where dots: true in options). specifically
.slick-dots
assignedrole=tablist
button
s (child elements of.slick-dots > li
or, the elements listening for the click event) are assigned the following attributes concerning a11y:role=tab
id=slick-slider-control[_.instanceUid][slickDotCounter]
where slickDotCounter is the (zero-based) index of this slick dot (out of the total number of slick dots)aria-controls=slick-slide[_.instanceUid][controlledSlideIndex]
where controlledSlideIndex is the (zero-based) slide index of the slide it advances to (e.g., if single item slick, dotaria-controls
corresponds 1-1 to slick slide indices; if multiple items, dotaria-controls
corresponds to every first slide in each "segment" [segment here meaning a set of slick slides displayed at one time on advancing through the carousel])aria-selected='true' || null
depending on whether the slide / slide group it controls is active / has focusaria-label="x of [total]"
where x is (one-based) index of current slick dot, within the total settabindex=0 || -1
depending on whether this slick dot is currently selected / activerole=tabpanel
id=slick-slide[_.instanceUid][_.instanceUid][slideIndex]
where slideIndex is (zero-based) index of this slick slide within the set belonging to this slick instancearia-describedby=slick-slide-control[_.instanceUid][controllingDotIndex]
where controllingDotIndex is the (zero-based) index of the slick dot associated with this slick slide _if there is a slick dot associated with this slide (will not be the case in multiple items)tabindex=0
) by tabbing once again (in inactive slides, these elements havetabindex=-1
) [used to set focus to the new current slide, this is NO LONGER the case]demo on jsfiddle
// accessibility: true
http://jsfiddle.net/cielt/bjg4p066/36/
⬆️ note: for ease of checking this, the demo fiddle slides have content with a link in them, which should receive focus on tabbing once the slide has changed
any questions please let me know. thanks!
notes
accessible js "widgets", focus management, relevant aria- attributes:
tab
(and tabpanel)accessible tabpanel examples: