You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 28, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: src/routes/_index/component/table/+page.marko
+73-44Lines changed: 73 additions & 44 deletions
Original file line number
Diff line number
Diff line change
@@ -2257,7 +2257,32 @@ import imgLandscapePic from "/src/routes/static/img/tb-landscape-pic.jpg";
2257
2257
</p>
2258
2258
2259
2259
<p>
2260
-
Additionally, in the loading state, the module should be inaccessible to the user. This can be achieved by setting <spanclass="highlight">tabindex="-1"</span> to the module container, and adding the <spanclass="highlight">inert</span> attribute to the <spanclass="highlight">table</span> inside the module. Since <spanclass="highlight">inert</span> is not fully supported in older browsers, it is recommended to either use a polyfill or use <spanclass="highlight">JavaScript</span> to disable all interactive elements inside the table when in loading state. Elements that support <spanclass="highlight">disabled</span> should be disabled. Anchors should have their <spanclass="highlight">href</span> attributes removed.
2260
+
Additionally, in the loading state, the module should be inaccessible to the user. This can be achieved by adding the <spanclass="highlight">inert</span> attribute to the <spanclass="highlight"><table></span> as well as <highlight>aria-hidden="true"</highlight>. Since <spanclass="highlight">inert</span> is not fully supported in older browsers, it is recommended to either use a polyfill or use <spanclass="highlight">JavaScript</span> to disable all interactive elements inside the table when in loading state. Elements that support <spanclass="highlight">disabled</span> should be disabled. Anchors should have their <spanclass="highlight">href</span> attributes removed.
Anchors that need to have their <highlight>href</highlight> attributes removed during loading, may require those href attributes to be restored once the loading state is done. For example, table head anchors that do server-side sorting/filtering. A good way to make those links inaccessible is to rename <highlight>href</highlight> to some other attribute, such as <highlight>data-href</highlight> during loading, and then revert them all back to <highlight>href</highlight> when loading state is complete.
2283
+
</p>
2284
+
</div>
2285
+
</section>
2261
2286
</p>
2262
2287
2263
2288
<p>
@@ -2271,13 +2296,13 @@ import imgLandscapePic from "/src/routes/static/img/tb-landscape-pic.jpg";
2271
2296
</p>
2272
2297
2273
2298
<p>
2274
-
The loading state should be displayed until the data is fully loaded. In addition to the loading state being set on the table, a progress bar expressive should be added to relay the loading state both visually and for screen readers. The live examples that follow use <spanclass="highlight">aria-live="off"</span> to prevent the status element from proactively announcing new content. This is only for demo purposes, so that this documentation page does not overwhelm the viewer with example status updates. The <spanclass="highlight">aria-live</span> override should not be included in implementations of this pattern.
2299
+
The loading state should be displayed until the data is fully loaded. In addition to the loading state being set on the table, a progress bar expressive should be added to relay the loading state both visually and for screen readers. The progress bar expressive should be placed inside an a live region, such as <highlight><div role="status" aria-live="polite"></div></highlight>.
2275
2300
</p>
2276
2301
2277
2302
<divclass="demo">
2278
2303
<divclass="demo__inner">
2279
-
<divclass="table table--loading-state"role="group"aria-label="Video games for sale"tabindex="-1">
2280
-
<tableinert>
2304
+
<divclass="table table--loading-state"role="group"aria-label="Video games for sale"tabindex="0">
2305
+
<tablearia-hidden="true"inert>
2281
2306
<thead>
2282
2307
<tr>
2283
2308
<thclass="table-cell"aria-sort="descending">
@@ -2532,25 +2557,27 @@ import imgLandscapePic from "/src/routes/static/img/tb-landscape-pic.jpg";
0 commit comments