-
Notifications
You must be signed in to change notification settings - Fork 359
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
Review accordion example #210
Comments
The "Role, Property, State, and Tabindex Attributes" indicates a region landmark. It is not my understanding that a landmark is required. Perhaps the description for the landmark should indicate it is 'optional'. |
I think, the anchor element within heading of accordion could be replaced with a button, as its implicit role=button. |
@aruns07 while I agree that is the better route to take, the point of the APG is to show have to apply ARIA. Using semantically correct HTML with implicit roles won’t do that. |
@MichielBijl the example may become a reference for developers. Developers may not get opportunity to find a better route, or read the spec https://www.w3.org/TR/wai-aria-1.1/#host_general_conflict |
@MichielBijl We are demonstrating how to implement the accordion pattern, which among other things, calls for headings containing a button that has In this case, it seems that the suggestion to use button is inline with the principle of using the minimum amount of ARIA to achieve the objective of the pattern. There are some patterns where we explicitly do not use the minimum amount of ARIA because it is necessary to demonstrate the appropriate use of specific roles and properties. For example, we have some grid examples that have I think I am on board with @aruns07's suggestion |
I think you have a valid point. However, in this implementation, the accordion information is structured using a It would be possible to build this accordion using Instead of adding a comment about region being optional, might it be simpler and cleaner to use |
I've seen public examples of both cases, where simulated active elements like divs and spans are used and when native active elements are used instead such as links and buttons. Unfortunately the scripting is very different between these two cases, and this needs to be demonstrated separately, because native active elements require only an onClick to function properly, whereas simulated active elements need to be made focusable and must include both onClick plus a key handler to simulate a click when Enter or Space is pressed. This is important because developers all too often assume the same technique that works on native active elements will work the same on simulated active elements, which causes ARIA widgets to break. In the accordion example here, I already included the scripting for both techniques so it won't matter at all if you change the link into a button or into a focusable div or span instead, so these bases are already covered by reading the JS comments. I'm not opposed to making one of these examples use a button instead of a link, in which case role="button" is not required on the active element. However I don't think we need to literally cover all markup possibilities when doing this, since these examples are meant to be downloaded and experimented with as well, so we can also include instructions and comments in the markup to show developers how they can successfully make these changes themselves without breaking anything. Regarding the use of named regions, this remains an important aspect of accordions that should be preserved as a best practice, otherwise it will be very difficult to locate the boundaries of multiple or nested accordions within the same page. |
VoiceOver (MacOS Sierra / Safari 10) recognises 4 regions instead of 3. "Personal information" is read as "button 1 of 4". Can't explain this behaviour unfortunately. |
#210 The possible approvement could be the introduction of a role "accordion" for the outer container. That would signal for scren readers and other ATs to allow in-widget keyboard. |
@MarioBatusic wrote:
First, thank you for your thoughtful feedback. The task force did discuss these types of concerns when we made the decision to set aside the tab-based approach to the accordion in favor of the current markup. Here is some of our thinking.
I am guessing that you mean, since there is not a reason for windows screen readers to automatically switch to application or focus mode that keys are not passed through. This is completely intentional because:
We plan to add the optional keys to the example (see issue #158).
An accordion role with an accompanying accordionheader role could do that. However, we may still be able to accomplish that end without more roles by offering an alternative pattern using vertical tabs for scenarios where the accordion content is primarily widgets. Generally, though, members of the task force, including all the screen reader users, see the heading/button approach is more helpful to both developers and users. Thank you for your review. It is important all these patterns are well vetted as we are focused on creating a viable product that can support ARIA 1.1 when it becomes a recommendation this spring. We have a long way to go just to get to a minimally viable deliverable. That is why we have pushed off some of the optional work. We welcome not only reviews but contributions. |
The task force will discuss this review in its February 6 teleconference, specifically addressing:
|
Great to see this example coming together. A few questions:
|
@jasonkiss wrote:
Yes, thanks! The
In general, I do not find the group role helpful as a content structure. It usually creates distracting verbosity rather than adding clarity. If region is not used, then, as you suggest, the heading structure and DOM order are adequate. I hope that a page with more than one accordion is not common. Sounds like UI asking for rework. That said, if there were lots of accordions, using region could create landmark overload. I agree that if we decide to include region in the pattern, that it should be an optional feature accompanied with appropriate guidance to avoid landmark overload. |
modified: examples/accordion/accordion1.html to address feedback in issue #210 from @jasonkiss: 1. Added role `presentation` to the `dl` element. 2. Added a row to the states and properties table for the presentation role. 3. Revised the `heading` row of the states and properties table. 4. Revised the `aria-level` row of the states and properties table.
modified aria-practices.html To address feedback from @annabbott and @jasonkiss in issue #210. Added the following text to the roles, states, and properties section of the accordion pattern: > Optionally, each element that serves as a container for panel content has role region and aria-labelledby with a value that refers to the button that controls display of the panel. > * Avoid using the region role in circumstances that create landmark region proliferation, e.g., in an accordion that contains more than approximately 6 panels that can be expanded at the same time. > * Role region is especially helpful to the perception of structure by screen reader users when panels contain heading elements or a nested accordion.
Thank you everyone for your feedback and assistance with this example. I have taken the following actions to address the feedback and am closing this review. Of course, feel free to reopen this issue if I have not adequately resolved a concern you have raised or create a new issue if you discover other problems. To address feedback related to guidance about using the region role on accordion panels and the possibility of landmark proliferation raised by @annabbott and @jasonkiss, in commit e07aa78, I added guidance in the states and properties section of the accordion design pattern about the option to make the panel into a landmark region. To address @jasonkiss feedback regarding the The task force has decided to keep the current implementation with To address feedback from @MarioBatusic regarding deficiencies in the semantic structure, I raised issue w3c/aria#530 for the ARIA specification. With respect to @Veyfeyken's results on Mac, I tested with voiceOver on Sierra in Chrome and Safari, I can not reproduce your experience. There is no position in set information announced at all because it is not part of this pattern. VO does announce the heading levels and the number of items inside of the region, so it is possible those are the messages you are hearing. It appears all the correct information is announced, and when you look at the counts in the rotor menu (ctrl-opt-u), everything is correct. |
@mcking65 I can't reproduce the VoiceOver issue in the current version either. The buttons are no longer announced as 'n' of 4. I do experience another, bigger VoiceOver-problem in the current version. Tested in Mac OS Sierra with Safari 10 and Firefox 51. It's not a problem in Chrome 56. To reproduce using the VO-keys:
Opening a panel sets the focus after the panel content? I cannot reproduce the problem in iOS, nor in Win10 with Firefox and NVDA or IE11 and Jaws. |
“Is it possible to modify this code to let user open/close multiple accordion?”
Yes, you can change the setting in js/setup.js to do this automatically if you wish.
From: dlaforestciao [mailto:[email protected]]
Sent: Friday, June 09, 2017 6:30 AM
To: w3c/aria-practices <[email protected]>
Cc: Bryan Garaventa <[email protected]>; Mention <[email protected]>
Subject: Re: [w3c/aria-practices] Review accordion example (#210)
Is it possible to modify this code to let user open/close multiple accordion?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#210 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/ABx1aLv1m1vl_HlGTONtxRdaESXAWjMXks5sCUjogaJpZM4LKRfV> . <https://github.com/notifications/beacon/ABx1aCJpDMiIFUyv3tLlt_G-zVTJHyhRks5sCUjogaJpZM4LKRfV.gif>
|
Examples that rely on aria roles instead of html elements that already have the necessary native semantics could be sending the wrong message to developers; e.g., examples that contradict the "first rule of aria use":
Demonstrating how roles could be used to achieve the desired results is understandable as an educational exercise. But they ought to be accompanied by examples where aria roles are either minimized or eliminated altogether; i.e., best practices. |
Final review of the accordion example page built by completion of issue #67 .
Status of requested reviews
Required updates based on feedback
dl
elementThe text was updated successfully, but these errors were encountered: