@@ -1338,15 +1338,15 @@ Note: In addition, as per [[#grouping]], the viewport of a <a for="/">browsing c
1338
1338
1339
1339
<div class=example>
1340
1340
The following example shows a simplified TV program schedule or calendar.
1341
- It has a grid of elements representing TV shows or calendar entries,
1341
+ It has a grid of elements representing TV shows or calendar entries
1342
1342
and some UI buttons around it.
1343
1343
1344
1344
In this case, the grid is quite sparse,
1345
1345
so if the user tries to move down from "Foo",
1346
1346
focus would be moved to "Next Week",
1347
1347
as it is objectively closer in the down direction.
1348
1348
The same is true for going down from "Bar":
1349
- the focus would be moved to "Previous Week".
1349
+ the focus would move to "Previous Week".
1350
1350
1351
1351
<div class=output>
1352
1352
<div id=example-cal>
@@ -1355,9 +1355,9 @@ Note: In addition, as per [[#grouping]], the viewport of a <a for="/">browsing c
1355
1355
<tr><td><th> M<th> T<th> W<th> T<th> F<th> S<th> S
1356
1356
<tr><td> 0-6<td><td><td><td><td><td><td> <a href="#">Foo</a>
1357
1357
<tr><td> 6-9<td> <a href="#">Bar</a> <td><td><td><td><td><td>
1358
- <tr><td> 9-12<td><td><td><td><td><td><td>
1358
+ <tr><td> 9-12<td><td> <a href="#">Bat</a> < td><td><td><td><td>
1359
1359
<tr><td> 12-18<td><td><td><td><td><td><td>
1360
- <tr><td> 18-21<td><td><td><td><td><td><td>
1360
+ <tr><td> 18-21<td><td><td><td><td><td><td> <a href="#">Woo</a>
1361
1361
<tr><td> 21-24<td><td><td><td><td><td> <a href="#">Baz</a> <td>
1362
1362
</table>
1363
1363
<button> Next Week</button>
@@ -1389,41 +1389,28 @@ Note: In addition, as per [[#grouping]], the viewport of a <a for="/">browsing c
1389
1389
<tr><td><th>M<th>T<th>W<th>T<th>F<th>S<th>S
1390
1390
<tr><td>0-6<td><td><td><td><td><td><td><a href="#">Foo</a>
1391
1391
<tr><td>6-9<td><a href="#">Bar</a><td><td><td><td><td><td>
1392
- <tr><td>9-12<td><td><td><td><td><td><td>
1392
+ <tr><td>9-12<td><td><a href="#">Bat</a>< td><td><td><td><td>
1393
1393
<tr><td>12-18<td><td><td><td><td><td><td>
1394
- <tr><td>18-21<td><td><td><td><td><td><td>
1394
+ <tr><td>18-21<td><td><td><td><td><td><td><a href="#">Woo</a>
1395
1395
<tr><td>21-24<td><td><td><td><td><td><a href="#">Baz</a><td>
1396
1396
</table>
1397
1397
<button>Next Week</button>
1398
1398
</div>
1399
1399
</code></pre>
1400
- <pre><code highlight=css>
1401
- table, td, th {
1402
- border-collapse: collapse;
1403
- border: solid 1px;
1404
- }
1405
- td { width: 12.5%; }
1406
- div {
1407
- display: grid;
1408
- grid-template-columns: auto 1fr auto;
1409
- }
1410
- button { align-self: center; }
1411
- </code></pre>
1412
1400
1413
- Because the elements in the table are semantically related to each other,
1414
- the author may want to provide a different navigation experience
1415
- giving priority to movements inside the grid once you have focused one of its items .
1401
+ However, the author may want to provide a different navigation experience
1402
+ giving priority to movements inside the grid once you have focused one of its items
1403
+ because the elements in the table are semantically related to each other .
1416
1404
1417
1405
Adding <code highlight=css> table { spatial-navigation-contain: contain; }</code> to the stylesheet
1418
1406
would result this behavior.
1419
- It would still be possible to move the focus out of the table,
1420
- for example by going right from "Foo".
1421
- Since there is nothing in the grid that is to the right,
1422
- the focus would move to "Next week".
1423
-
1424
- However, if the user navigates down from "Foo",
1425
- there is something inside the grid,
1426
- so focus will move there without considering things that are outside.
1407
+
1408
+ After that, the focus would move down from "Foo" to "Woo" instead of "Next Week",
1409
+ and from "Bar" to "Bat" instead of "Previous Week".
1410
+
1411
+ It would still be possible to move the focus out of the table.
1412
+ For example, the focus would move to "Next week" by going right from "Foo"
1413
+ since there is nothing in the grid that is to the right.
1427
1414
</div>
1428
1415
1429
1416
Note: the 'spatial-navigation-contain' property is <a>at-risk</a> .
0 commit comments