-
Notifications
You must be signed in to change notification settings - Fork 353
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
Restructure accordion example to remove DL, DT and DD elements for issue 815 #838
Restructure accordion example to remove DL, DT and DD elements for issue 815 #838
Conversation
Just wondering; what is the reason for using role heading aria-level on a div element and not a native hx? Also does this mean the suggestion < section >, for the accordion panel, was dropped? Thanks. |
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.
@jongund, thank you very much for this PR.
It's going in the desired direction. However, there are some conflicts that need to be resolved and some changes that need to be made. Please see my comments in th HTML file.
examples/accordion/accordion.html
Outdated
@@ -49,19 +49,17 @@ <h2 id="ex_label">Example</h2> | |||
|
|||
Ex: | |||
<dl id="accordionGroup" role="presentation" class="Accordion" data-allow-multiple> |
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.
This comment needs to be updated to not show ``dl`
examples/accordion/accordion.html
Outdated
@@ -49,19 +49,17 @@ <h2 id="ex_label">Example</h2> | |||
|
|||
Ex: | |||
<dl id="accordionGroup" role="presentation" class="Accordion" data-allow-multiple> | |||
|
|||
<dl id="accordionGroup" role="presentation" class="Accordion" data-allow-toggle> |
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.
same
examples/accordion/accordion.html
Outdated
--> | ||
<dl id="accordionGroup" role="presentation" class="Accordion"> | ||
<dt role="heading" aria-level="3"> | ||
<div id="accordionGroup" role="presentation" class="Accordion"> |
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.
We do not need role presentation on a div (yes, sometimes if it has a tooltip you do that to avoid issues on Mac, but don't have that situation here)
examples/accordion/accordion.html
Outdated
<dl id="accordionGroup" role="presentation" class="Accordion"> | ||
<dt role="heading" aria-level="3"> | ||
<div id="accordionGroup" role="presentation" class="Accordion"> | ||
<div role="heading" aria-level="3"> |
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.
We want a h3
element here
examples/accordion/accordion.html
Outdated
</dd> | ||
<dt role="heading" aria-level="3"> | ||
</div> | ||
<div role="heading" aria-level="3"> |
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.
We want a h3
element here
@@ -128,15 +126,15 @@ <h2 id="ex_label">Example</h2> | |||
</p> | |||
</fieldset> | |||
</div> | |||
</dd> | |||
<dt role="heading" aria-level="3"> |
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.
We want a h3
element here
examples/accordion/accordion.html
Outdated
@@ -248,7 +245,7 @@ <h2 id="rps_label">Role, Property, State, and Tabindex Attributes</h2> | |||
<tr> | |||
<th scope="row"><code>presentation</code></th> | |||
<td></td> | |||
<td><code>dl</code></td> | |||
<td><code>div</code></td> | |||
<td> | |||
<ul> | |||
<li>Indicates that the <code>dl</code> element is being used to control presentation and does not represent a definition list.</li> |
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.
We can delete this row of the table
examples/accordion/accordion.html
Outdated
@@ -259,13 +256,13 @@ <h2 id="rps_label">Role, Property, State, and Tabindex Attributes</h2> | |||
<tr> | |||
<th scope="row"><code>heading</code></th> | |||
<td></td> | |||
<td><code>dt</code></td> | |||
<td><code>div</code></td> | |||
<td>Identifies the element as a heading that serves as an accordion header.</td> |
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.
We can delete this row of table; no ARIA required to make the accordion header into a heading.
examples/accordion/accordion.html
Outdated
<td>Identifies the element as a heading that serves as an accordion header.</td> | ||
</tr> | ||
<tr> | ||
<td></td> | ||
<th scope="row"><code>aria-level=<q>3</q></code></th> | ||
<td><code>dt</code></td> | ||
<td><code>div</code></td> | ||
<td> | ||
<ul> | ||
<li>Specifies heading level for the accordion header.</li> |
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.
We can delete this row of table
Matt, I update the accordion example to fix the heading issue and added improved focus styling. |
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.
@jongund, this is much closer.
examples/accordion/accordion.html
Outdated
@@ -38,30 +38,17 @@ <h2 id="ex_label">Example</h2> | |||
<div role="separator" id="ex_start_sep" aria-labelledby="ex_start_sep ex_label" aria-label="Start of"></div> | |||
<div id="coding-arena"> | |||
<div class="demo-block"> | |||
<!-- Accordion Configuration Options |
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.
Was this accidental removal? We do not want to remove these config options or their documentation.
examples/accordion/accordion.html
Outdated
> | ||
<span class="Accordion-title">Personal Information</span><span class="Accordion-icon"></span> | ||
aria-controls="sect1" id="accordion1id"> | ||
<div class="Accordion-title"> |
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.
What is reason for changing from span to div? The validator is failing this; says div not allowed in this context as child of button.
@sh0ji, could you please look at the css/js changes for focus styling? |
I add the source code documentation back in. |
Matt, I have created a new branch that adds the accordion behavior options, so when your ready I can add them to the example: Jon |
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.
I appreciate the visual updates here, especially the move toward giving a visual indicator that the parent container gives context for interior focus. Discoverability of roving/activedescendant focus management is often awful for sighted users, and this helps a lot.
My feedback is mostly just nitpicky stuff that doesn't have a huge impact on accessibility (visual or otherwise).
examples/accordion/css/accordion.css
Outdated
padding: 0; | ||
} | ||
|
||
.Accordion *:first-child .Accordion-trigger { |
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.
} | ||
|
||
.Accordion-trigger:focus .Accordion-title { | ||
border-color: hsl(216, 94%, 73%); |
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.
The .Accordion-trigger
already has a visual change on focus, so I'm not entirely clear what purpose this serves. It also gives the visual impression that only the .Accordion-title
is focused, or that the .Accordion-title
is the clickable area, neither of which is true.
Another note that I forgot: I'd like to be able to click into the widget with my mouse, and then navigate around it with my keyboard. This is currently not possible because the click listener is preventing focus on the buttons. |
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.
@jongund, Please address the 4 changes needed to remove role presentation and fix the HTML validation issues. That's the minimum we need before @spectranaut works on the tests. Ideally, if you have time, address the comments from @sh0ji.
examples/accordion/accordion.html
Outdated
<dl id="accordionGroup" role="presentation" class="Accordion" data-allow-multiple> | ||
|
||
<dl id="accordionGroup" role="presentation" class="Accordion" data-allow-toggle> | ||
<div id="accordionGroup" role="presentation" class="Accordion" data-allow-multiple> |
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.
Please remove role presentation
examples/accordion/accordion.html
Outdated
|
||
<div id="accordionGroup" role="presentation" class="Accordion" data-allow-toggle> |
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.
Please remove role presentation
examples/accordion/accordion.html
Outdated
--> | ||
<dl id="accordionGroup" role="presentation" class="Accordion"> | ||
<dt role="heading" aria-level="3"> | ||
<div id="accordionGroup" role="presentation" class="Accordion"> |
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.
Please remove role presentation
@@ -248,7 +268,7 @@ <h2 id="rps_label">Role, Property, State, and Tabindex Attributes</h2> | |||
<tr> |
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.
Please remove this row
I have updated the example to fix the outstanding issues, please review to check my changes |
examples/accordion/accordion.html
Outdated
</ul> | ||
</td> | ||
<li>The accordion design pattern is defined by a button is contained within an element with <code>role=heading</code>.</li> | ||
<li>The default role for the <code>h3</code> element is <code>heading</code>.</li> |
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.
This sentence: "The accordion design pattern is defined by a button is contained within an element with role=heading."
- either needs "that" added after "button", i.e. "...a button that is contained within..."
- OR the "is" after "button" can be deleted, i.e. "...a button contained within..."
Resolves merge conflicts with base branch for pr #838.
@jongund, I just pushed commit 45ad1e0 to your fork to:
|
examples/accordion/accordion.html
Outdated
@@ -299,7 +301,11 @@ <h2 id="rps_label">Role, Property, State, and Tabindex Attributes</h2> | |||
</td> | |||
</tr> | |||
<tr data-test-id="region-role"> | |||
<<<<<<< HEAD |
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.
Merge conflict here
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.
Yap, noticed soon as the test build completed; fixed in next commit along with editorial corrections. Thanks.
1. Remove role presentation from example divs in the comments. 2. Revise wording of accessibility features section. 3. Fix merge conflict overlooked in previous commit.
@sh0ji, are the issues you raised resolved as well? |
1. Add missing `ul` closing tags 2. Revise landmark region documentation in roles, states, and properties.
@mcking65, I'm still unsure what the inner focus-ring's role is since it gives the impression that the clickable area is smaller than it actually is, but I wouldn't consider that a blocking issue. Everything else appears to be resolved. @Decrepidos, the |
@sh0ji Thank you |
For issue #815, updates the accordion example to remove DL, DT and DD elements. Also changes focus styling.
Preview link
New accordion example page in accordion branch of Jon's repo
Compare to:
Current Accordion in master