Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 07b4b38

Browse files
committed
Add example
1 parent 271d1d6 commit 07b4b38

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

examples/index.html

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,14 @@
2222
text-align: left;
2323
padding: 0;
2424
}
25+
[aria-disabled="true"] {
26+
color: gray;
27+
}
2528
</style>
2629
</head>
2730
<body>
28-
<h1>Base examples</h1>
31+
<h1>Examples</h1>
32+
<h2>Base examples</h2>
2933

3034
<details>
3135
<summary>Best robot: <span data-menu-button>Unknown</span></summary>
@@ -69,7 +73,19 @@ <h1>Base examples</h1>
6973
</details-menu>
7074
</details>
7175

72-
<h1>Autofocus example</h1>
76+
<h2>`aria-disabled="true" example</h2>
77+
<p>menu items with <code>aria-disabled="true"</code> should be keyboard navigable</p>
78+
<details>
79+
<summary data-menu-button autofocus>Least favorite robots</summary>
80+
<details-menu>
81+
<input type="text" autofocus />
82+
<button name="robot" value="Hubot" aria-disabled="true" role="menuitemradio" data-menu-button-text>Hubot</button>
83+
<button name="robot" value="Bender" role="menuitemradio" data-menu-button-text>Bender</button>
84+
<button name="robot" value="BB-8" role="menuitemradio" data-menu-button-text>BB-8</button>
85+
</details-menu>
86+
</details>
87+
88+
<h2>Autofocus example</h2>
7389
<p><code>summary</code> may have <code>autofocus</code> so it's the initially focused element in the page.</p>
7490
<p>
7591
Then any focusable element inside the popup can declare autofocus too, so it gets focus when the popup is opened.

0 commit comments

Comments
 (0)