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

Navigation Treeview Example: Convert to single page example with functionality equivalent to disclosure navigation example #1558

Merged
merged 81 commits into from
Jan 19, 2021
Merged
Show file tree
Hide file tree
Changes from 75 commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
3aa7456
initial changes to treeview navigation
jongund Oct 6, 2020
165b50c
updated content creator
jongund Oct 7, 2020
dcdf4fc
updated dummy content
jongund Oct 7, 2020
c2ac656
udpated generating content, added landmarks and added open siblings
jongund Oct 7, 2020
67cca26
wrote some intial test for treeview navigation
jongund Oct 7, 2020
c8388f1
updated landmarks
jongund Oct 7, 2020
9f87f09
updated landmarks
jongund Oct 7, 2020
de7aa44
added word tuition to spelling
jongund Oct 7, 2020
0d8021f
fixed spelling mistake
jongund Oct 7, 2020
3c351ed
Update examples/treeview/treeview-navigation.html
jongund Oct 8, 2020
c807321
fixed some validation issues
jongund Oct 8, 2020
3a1ab47
fixed comment issue
jongund Oct 8, 2020
995fb94
added links to content
jongund Oct 8, 2020
500c5ad
updated tests and added space to default action
jongund Oct 8, 2020
5c2ef38
updated links to source code
jongund Oct 8, 2020
b844cef
fixed name function
jongund Oct 8, 2020
11773e0
updated to use SVG images
jongund Oct 15, 2020
708b63b
updated to use SVG images
jongund Oct 15, 2020
c9a5505
updated to use SVG images
jongund Oct 15, 2020
24c8d25
fixed linting error
jongund Oct 16, 2020
852bb4e
Merge branch 'master' into update-tree-nav
jongund Oct 19, 2020
72f7df7
merged master
jongund Oct 22, 2020
5e54c85
updated focus to h1, fixed left arrow bug, added landmarks
jongund Oct 22, 2020
b24cb59
fixed linting errors
jongund Oct 22, 2020
0a48d1c
fixed linting errors
jongund Oct 22, 2020
5b54bd1
added code pen support
jongund Oct 22, 2020
2c21881
added test cases fixed keyboard bugs
jongund Oct 23, 2020
99df35d
updated from master
jongund Oct 23, 2020
a2f76ee
updated spell
jongund Oct 23, 2020
89cffce
updated regression testing, documentation for landmarks, and fixed ke…
jongund Oct 24, 2020
5330813
removed roving tabindex and fixed HC for aria-current
jongund Oct 24, 2020
af06a79
fixed spelling and formatting bus, updated tabindex=0 documentation
jongund Oct 24, 2020
c9fd8cd
changed some aria-current styling
jongund Oct 24, 2020
e19a52d
fixed entities
jongund Oct 24, 2020
897a804
updated documentation on visual indication of aria-current
jongund Oct 24, 2020
af088b6
fixed linting bug
jongund Oct 24, 2020
321f9b7
updated event handlers to use 'on' instead of 'handle'
jongund Oct 25, 2020
c8bb09b
Update treeview-navigation.html
jongund Oct 26, 2020
391af5d
update documentation and adjust label for region
jongund Oct 27, 2020
6a9b4aa
fixed conflicts
jongund Nov 10, 2020
ffe2b41
fixed bug in showing aria-current link in treeview
jongund Nov 10, 2020
865f581
fixed spelling errors
jongund Nov 10, 2020
3aaea23
fixed spelling errors
jongund Nov 10, 2020
43aa5d7
Fix href in design pattern link in header and footer
mcking65 Nov 14, 2020
65d305d
Shorten title since we will now have just one nav tree example
mcking65 Nov 14, 2020
a335433
Add caution note at top directing people to disclosure pattern
mcking65 Nov 14, 2020
0fefffe
Revise intro
mcking65 Nov 14, 2020
cc241ed
fix missing word
carmacleod Nov 16, 2020
fbfd03c
updated aria-current styling
jongund Nov 20, 2020
02a7fd7
Add orange box style for the cautionary note (#1643)
carmacleod Dec 3, 2020
d22dc55
fixed conflicts
jongund Dec 4, 2020
d737efa
fixed coding practices and code pen issues
jongund Dec 4, 2020
3c6dae1
fixed linting errors
jongund Dec 4, 2020
3e0a292
Merge branch 'master' into update-tree-nav
mcking65 Dec 14, 2020
4f54e20
Fix some hrefs pointing to main doc and update examples index
mcking65 Dec 14, 2020
3315b1f
Editorial revision to comment about banner role
mcking65 Dec 14, 2020
ecdd900
navigational -> navigation
mcking65 Dec 14, 2020
5d9cfef
Editorial revision to footer contentinfo comment
mcking65 Dec 14, 2020
0459508
Incorporate high contrast documentation wording agreed upon for menu …
mcking65 Dec 14, 2020
9999add
Add content to accessibility features about the current page tree item
mcking65 Dec 14, 2020
3e816b9
Add documentation about enter key options
mcking65 Dec 14, 2020
0f5772b
Minor edits to prior commit
mcking65 Dec 14, 2020
1798def
Revise enter key behavior documentation
mcking65 Dec 14, 2020
46cf14a
Replace named entities for quote inside code tags with quote character
mcking65 Dec 14, 2020
d415aeb
Minor editorial revisions to landmark documentation
mcking65 Dec 14, 2020
2f7e89a
Simplify treeitem role documentation since treeitem role is only on l…
mcking65 Dec 14, 2020
47743bf
Minor editorial revisions to states and props documentation
mcking65 Dec 14, 2020
e4baab2
Fix 2 nits
mcking65 Dec 14, 2020
070e669
Remove links to old nav treeview examples and add links to new one
mcking65 Dec 14, 2020
9ecb722
made edits to accessibility notes
jongund Dec 14, 2020
1947ea0
made edits to note
jongund Dec 14, 2020
1acbbbc
Remove 'should' from Jon's keyboard note and simplify wording
mcking65 Dec 15, 2020
91a4198
fixed description of aria-current visual indication
jongund Dec 15, 2020
836829d
Merge branch 'update-tree-nav' of github.com:w3c/aria-practices into …
jongund Dec 15, 2020
7708e74
add some padding to the main class
jongund Dec 15, 2020
56d1d24
improved hover color contrast
jongund Dec 15, 2020
7afebf0
fixed bug in aria-current being visible when treeview loses focus
jongund Jan 12, 2021
92b6c21
added test case for aria-current always being visible
jongund Jan 12, 2021
7f28a94
Update examples/treeview/treeview-navigation.html
jongund Jan 13, 2021
529b455
Merge in latest master and fix conflicts
mcking65 Jan 19, 2021
1f9ca3b
Fix spelling in test script comment and update cspell.json
mcking65 Jan 19, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions aria-practices.html
Original file line number Diff line number Diff line change
Expand Up @@ -2885,13 +2885,9 @@ <h4>Examples</h4>
A file selector tree that demonstrates how to explicitly define values for <code>aria-level</code>, <code>aria-posinset</code> and <code>aria-setsize</code>.
</li>
<li>
<a href="examples/treeview/treeview-2/treeview-2a.html">Navigation Treeview Example Using Computed Properties</a>:
<a href="examples/treeview/treeview-navigation.html">Navigation Treeview Example</a>:
A tree that provides navigation to a set of web pages and demonstrates browser support for automatically computing <code>aria-level</code>, <code>aria-posinset</code> and <code>aria-setsize</code> based on DOM structure.
</li>
<li>
<a href="examples/treeview/treeview-2/treeview-2b.html">Navigation Treeview Example Using Declared Properties</a>:
A tree that provides navigation to a set of web pages and demonstrates how to explicitly define values for <code>aria-level</code>, <code>aria-posinset</code> and <code>aria-setsize</code>.
</li>
</ul>
</section>

Expand Down
1 change: 1 addition & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
"Moscovium",
"MSAA",
"multithumb",
"navs",
"Nemeth",
"Nihonium",
"nodir",
Expand Down
53 changes: 34 additions & 19 deletions examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ <h2 id="examples_by_role_label">Examples by Role</h2>
</tr>
<tr>
<td><code>banner</code></td>
<td><a href="landmarks/banner.html">Banner Landmark</a></td>
<td>
<ul>
<li><a href="treeview/treeview-navigation.html">Navigation Treeview</a></li>
<li><a href="landmarks/banner.html">Banner Landmark</a></li>
</ul>
</td>
</tr>
<tr>
<td><code>button</code></td>
Expand Down Expand Up @@ -91,7 +96,12 @@ <h2 id="examples_by_role_label">Examples by Role</h2>
</tr>
<tr>
<td><code>contentinfo</code></td>
<td><a href="landmarks/contentinfo.html">Contentinfo Landmark</a></td>
<td>
<ul>
<li><a href="treeview/treeview-navigation.html">Navigation Treeview</a></li>
<li><a href="landmarks/contentinfo.html">Contentinfo Landmark</a></li>
</ul>
</td>
</tr>
<tr>
<td><code>dialog</code></td>
Expand Down Expand Up @@ -135,8 +145,7 @@ <h2 id="examples_by_role_label">Examples by Role</h2>
<li><a href="checkbox/checkbox-1/checkbox-1.html">Checkbox (Two State)</a></li>
<li><a href="menubar/menubar-editor.html">Editor Menubar</a></li>
<li><a href="spinbutton/datepicker-spinbuttons.html">Date Picker Spin Button</a></li>
<li><a href="treeview/treeview-2/treeview-2a.html">Navigation Treeview Using Computed Properties</a></li>
<li><a href="treeview/treeview-2/treeview-2b.html">Navigation Treeview Using Declared Properties</a></li>
<li><a href="treeview/treeview-navigation.html">Navigation Treeview</a></li>
</ul>
</td>
</tr>
Expand Down Expand Up @@ -211,7 +220,12 @@ <h2 id="examples_by_role_label">Examples by Role</h2>
</tr>
<tr>
<td><code>navigation</code></td>
<td><a href="landmarks/navigation.html">Navigation Landmark</a></td>
<td>
<ul>
<li><a href="treeview/treeview-navigation.html">Navigation Treeview</a></li>
<li><a href="landmarks/navigation.html">Navigation Landmark</a></li>
</ul>
</td>
</tr>
<tr>
<td><code>none</code></td>
Expand Down Expand Up @@ -343,8 +357,7 @@ <h2 id="examples_by_role_label">Examples by Role</h2>
<ul>
<li><a href="treeview/treeview-1/treeview-1a.html">File Directory Treeview Using Computed Properties</a></li>
<li><a href="treeview/treeview-1/treeview-1b.html">File Directory Treeview Using Declared Properties</a></li>
<li><a href="treeview/treeview-2/treeview-2a.html">Navigation Treeview Using Computed Properties</a></li>
<li><a href="treeview/treeview-2/treeview-2b.html">Navigation Treeview Using Declared Properties</a></li>
<li><a href="treeview/treeview-navigation.html">Navigation Treeview</a></li>
</ul>
</td>
</tr>
Expand All @@ -358,8 +371,7 @@ <h2 id="examples_by_role_label">Examples by Role</h2>
<ul>
<li><a href="treeview/treeview-1/treeview-1a.html">File Directory Treeview Using Computed Properties</a></li>
<li><a href="treeview/treeview-1/treeview-1b.html">File Directory Treeview Using Declared Properties</a></li>
<li><a href="treeview/treeview-2/treeview-2a.html">Navigation Treeview Using Computed Properties</a></li>
<li><a href="treeview/treeview-2/treeview-2b.html">Navigation Treeview Using Declared Properties</a></li>
<li><a href="treeview/treeview-navigation.html">Navigation Treeview</a></li>
</ul>
</td>
</tr></tbody>
Expand Down Expand Up @@ -453,7 +465,12 @@ <h2 id="examples_by_props_label">Examples By Properties and States</h2>
</tr>
<tr>
<td><code>aria-current</code></td>
<td><a href="disclosure/disclosure-navigation.html">Disclosure for Navigation Menus</a></td>
<td>
<ul>
<li><a href="disclosure/disclosure-navigation.html">Disclosure for Navigation Menus</a></li>
<li><a href="treeview/treeview-navigation.html">Navigation Treeview</a></li>
</ul>
</td>
</tr>
<tr>
<td><code>aria-describedby</code></td>
Expand Down Expand Up @@ -502,8 +519,7 @@ <h2 id="examples_by_props_label">Examples By Properties and States</h2>
<li><a href="treegrid/treegrid-1.html">Treegrid Email Inbox</a></li>
<li><a href="treeview/treeview-1/treeview-1a.html">File Directory Treeview Using Computed Properties</a></li>
<li><a href="treeview/treeview-1/treeview-1b.html">File Directory Treeview Using Declared Properties</a></li>
<li><a href="treeview/treeview-2/treeview-2a.html">Navigation Treeview Using Computed Properties</a></li>
<li><a href="treeview/treeview-2/treeview-2b.html">Navigation Treeview Using Declared Properties</a></li>
<li><a href="treeview/treeview-navigation.html">Navigation Treeview</a></li>
</ul>
</td>
</tr>
Expand Down Expand Up @@ -571,8 +587,7 @@ <h2 id="examples_by_props_label">Examples By Properties and States</h2>
<li><a href="treegrid/treegrid-1.html">Treegrid Email Inbox</a></li>
<li><a href="treeview/treeview-1/treeview-1a.html">File Directory Treeview Using Computed Properties</a></li>
<li><a href="treeview/treeview-1/treeview-1b.html">File Directory Treeview Using Declared Properties</a></li>
<li><a href="treeview/treeview-2/treeview-2a.html">Navigation Treeview Using Computed Properties</a></li>
<li><a href="treeview/treeview-2/treeview-2b.html">Navigation Treeview Using Declared Properties</a></li>
<li><a href="treeview/treeview-navigation.html">Navigation Treeview</a></li>
</ul>
</td>
</tr>
Expand Down Expand Up @@ -604,8 +619,7 @@ <h2 id="examples_by_props_label">Examples By Properties and States</h2>
<li><a href="tabs/tabs-2/tabs.html">Tabs with Manual Activation</a></li>
<li><a href="treeview/treeview-1/treeview-1a.html">File Directory Treeview Using Computed Properties</a></li>
<li><a href="treeview/treeview-1/treeview-1b.html">File Directory Treeview Using Declared Properties</a></li>
<li><a href="treeview/treeview-2/treeview-2a.html">Navigation Treeview Using Computed Properties</a></li>
<li><a href="treeview/treeview-2/treeview-2b.html">Navigation Treeview Using Declared Properties</a></li>
<li><a href="treeview/treeview-navigation.html">Navigation Treeview</a></li>
<li><a href="landmarks/complementary.html">Complementary Landmark</a></li>
<li><a href="landmarks/form.html">Form Landmark</a></li>
<li><a href="landmarks/main.html">Main Landmark</a></li>
Expand All @@ -622,7 +636,6 @@ <h2 id="examples_by_props_label">Examples By Properties and States</h2>
<li><a href="treegrid/treegrid-1.html">Treegrid Email Inbox</a></li>
<li><a href="treeview/treeview-1/treeview-1a.html">File Directory Treeview Using Computed Properties</a></li>
<li><a href="treeview/treeview-1/treeview-1b.html">File Directory Treeview Using Declared Properties</a></li>
<li><a href="treeview/treeview-2/treeview-2b.html">Navigation Treeview Using Declared Properties</a></li>
</ul>
</td>
</tr>
Expand Down Expand Up @@ -656,6 +669,10 @@ <h2 id="examples_by_props_label">Examples By Properties and States</h2>
<td><code>aria-orientation</code></td>
<td><a href="slider/slider-2.html">Slider with aria-orientation and aria-valuetext</a></td>
</tr>
<tr>
<td><code>aria-owns</code></td>
<td><a href="treeview/treeview-navigation.html">Navigation Treeview</a></td>
</tr>
<tr>
<td><code>aria-posinset</code></td>
<td>
Expand All @@ -664,7 +681,6 @@ <h2 id="examples_by_props_label">Examples By Properties and States</h2>
<li><a href="treegrid/treegrid-1.html">Treegrid Email Inbox</a></li>
<li><a href="treeview/treeview-1/treeview-1a.html">File Directory Treeview Using Computed Properties</a></li>
<li><a href="treeview/treeview-1/treeview-1b.html">File Directory Treeview Using Declared Properties</a></li>
<li><a href="treeview/treeview-2/treeview-2b.html">Navigation Treeview Using Declared Properties</a></li>
</ul>
</td>
</tr>
Expand Down Expand Up @@ -727,7 +743,6 @@ <h2 id="examples_by_props_label">Examples By Properties and States</h2>
<li><a href="treegrid/treegrid-1.html">Treegrid Email Inbox</a></li>
<li><a href="treeview/treeview-1/treeview-1a.html">File Directory Treeview Using Computed Properties</a></li>
<li><a href="treeview/treeview-1/treeview-1b.html">File Directory Treeview Using Declared Properties</a></li>
<li><a href="treeview/treeview-2/treeview-2b.html">Navigation Treeview Using Declared Properties</a></li>
</ul>
</td>
</tr>
Expand Down
160 changes: 160 additions & 0 deletions examples/treeview/css/treeview-navigation.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
.page header {
border: #005a9c solid 2px;
background: #005a9c;
color: white;
text-align: center;
}

.page header .title {
font-size: 2.5em;
font-weight: bold;
font-family: serif;
}

.page header .tagline {
font-style: italic;
}

.page footer {
border: #005a9c solid 2px;
background: #005a9c;
font-family: serif;
color: white;
font-style: italic;
padding-left: 1em;
}

.page .body {
display: grid;
grid-template-columns: auto auto;
border: #eee solid 2px;
}

.page .body nav {
margin: 0;
padding: 6px;
width: 17em;
height: 60em;
background: #eee;
}

.page .body nav.focus {
padding: 4px;
border: 2px solid #005a9c;
}

.page .body .page {
margin: 0.25em;
padding: 0.25em;
height: 30em;
}

.page .body .page h1 {
margin: 0;
padding: 0;
}

.page .main {
padding: 1em;
}

.treeview-navigation ul,
.treeview-navigation li {
margin: 0;
padding: 0;
}

.treeview-navigation li li span.label {
padding-left: 1em;
}

.treeview-navigation li li li span.label {
padding-left: 2em;
}

.treeview-navigation[role="tree"] {
margin: 0;
padding: 0;
list-style: none;
}

.treeview-navigation[role="tree"] li {
margin: 0;
padding: 0;
list-style: none;
}

.treeview-navigation a[role="treeitem"] ul {
margin: 0;
padding: 0;
}

.treeview-navigation
a[role="treeitem"][aria-expanded="false"]
+ [role="group"] {
display: none;
}

.treeview-navigation a[role="treeitem"][aria-expanded="true"] + [role="group"] {
display: block;
}

.treeview-navigation a[role="treeitem"] > span svg {
transform: translate(0, 0);
}

.treeview-navigation a[role="treeitem"][aria-expanded="false"] > span svg {
transform: rotate(270deg) translate(2px, 2px);
}

.treeview-navigation a[role="treeitem"] {
margin: 0;
padding: 4px;
padding-left: 9px;
text-decoration: none;
color: #005a9c;
border: none;
display: block;
}

.treeview-navigation a[role="treeitem"][aria-current] {
border-left: 5px solid #005a9c;
padding-left: 4px;
background-color: #ddd;
}

.treeview-navigation a[role="treeitem"] span.icon svg polygon {
stroke-width: 2px;
fill: currentColor;
stroke: transparent;
}

/* disable default keyboard focus styling for treeitems
Keyboard focus is styled with the following CSS */

.treeview-navigation a[role="treeitem"]:focus {
outline: 0;
padding: 2px;
padding-left: 7px;
border: 2px #005a9c solid;
}

.treeview-navigation a[role="treeitem"][aria-current]:focus {
padding-left: 4px;
border-left-width: 5px;
}

.treeview-navigation a[role="treeitem"]:hover {
background-color: #ccc;
text-decoration: underline;
padding-left: 4px;
border-left: 5px solid #333;
}

.treeview-navigation a[role="treeitem"] span.icon:hover {
color: #333;
}

.treeview-navigation a[role="treeitem"] span.icon svg polygon:hover {
stroke: currentColor;
}
4 changes: 4 additions & 0 deletions examples/treeview/images/aria-current.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/treeview/images/down-arrow-brown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/treeview/images/right-arrow-brown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading