mirror of
https://github.com/picocss/pico.git
synced 2025-04-22 09:26:14 -04:00
chore: updated implementation with proper roles and aria attributes
This commit is contained in:
parent
25d7c7983f
commit
aaa4aebb2f
15 changed files with 81 additions and 81 deletions
|
@ -18,9 +18,9 @@
|
|||
<h2>single / multi select dropdown, without JavaScript.</h2>
|
||||
</hgroup>
|
||||
<article aria-label="Dropdown examples">
|
||||
<details role="dropdown">
|
||||
<summary>Single select</summary>
|
||||
<ul>
|
||||
<details role="list">
|
||||
<summary aria-haspopup="listbox">Single select</summary>
|
||||
<ul role="listbox">
|
||||
<li>
|
||||
<input type="radio" id="01" name="option1" />
|
||||
<label for="01">Option 1</label>
|
||||
|
@ -31,9 +31,9 @@
|
|||
</li>
|
||||
</ul>
|
||||
</details>
|
||||
<details role="dropdown">
|
||||
<summary>Multi-select</summary>
|
||||
<ul>
|
||||
<details role="list">
|
||||
<summary aria-haspopup="listbox">Multi-select</summary>
|
||||
<ul role="listbox">
|
||||
<li>
|
||||
<input type="checkbox" id="11" name="option2" />
|
||||
<label for="11">Option 1</label>
|
||||
|
@ -50,7 +50,7 @@
|
|||
<ul>
|
||||
<li>
|
||||
in order to use dropdown component, use
|
||||
<code>role='dropdown'</code> on details tag.
|
||||
<code>role='list'</code> on details tag.
|
||||
</li>
|
||||
<li>
|
||||
no need to use javascript to close the dropdown when clicked
|
||||
|
@ -70,9 +70,9 @@
|
|||
<code>
|
||||
<em>For Single-select</em>
|
||||
<em>===============================</em>
|
||||
<<b>details role="dropdown"</b>>
|
||||
<<b>summary</b>>Single select<<b>/summary</b>>
|
||||
<<b>ul</b>>
|
||||
<<b>details role="list"</b>>
|
||||
<<b>summary aria-haspopup="listbox"</b>>Single select<<b>/summary</b>>
|
||||
<<b>ul role="listbox"</b>>
|
||||
<<b>li</b>>
|
||||
<<b>input type="radio" id="01" name="option1" /</b>>
|
||||
<<b>label for="01"</b>>Option 1<<b>/label</b>>
|
||||
|
@ -87,9 +87,9 @@
|
|||
|
||||
<em>For Multi-select</em>
|
||||
<em>===============================</em>
|
||||
<<b>details role="dropdown"</b>>
|
||||
<<b>summary</b>>Multi select<<b>/summary</b>>
|
||||
<<b>ul</b>>
|
||||
<<b>details role="list"</b>>
|
||||
<<b>summary aria-haspopup="listbox"</b>>Multi select<<b>/summary</b>>
|
||||
<<b>ul role="listbox"</b>>
|
||||
<<b>li</b>>
|
||||
<<b>input type="checkbox" id="01" name="option1" /</b>>
|
||||
<<b>label for="01"</b>>Option 1<<b>/label</b>>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue