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
<metaname="description" content="element.getSpatnavContainer() return nearest ancestor node which is spatial navigation container (a.k.a. spatnav container). You can check the result of element.getSpatnavContainer() as background-color whenever focus is changed.">
8
+
<metaname="description" content="element.getSpatnavContainer() returns the nearest ancestor node which is the spatial navigation container (a.k.a. spatnav container).
9
+
You can check the result of element.getSpatnavContainer() via 'background-color' whenever focus is changed.">
<metaname="description" content="navigate ({dir}) moves the focus to a specific direction. In this demo page, you can use WASD key to move the focus in red container.">
8
+
<metaname="description" content="window.navigate ({dir}) moves the focus in a specific direction.
9
+
When the foucs moves inside the element with the red border., you can move the focus with WASD keys.">
<metaname="description" content="element.spatNavSearch(SpatNavSearchOptions) return next best target. You can check the result of element.spatNavSearch() as border-color.">
8
+
<metaname="description" content="element.spatNavSearch(SpatNavSearchOptions) returns the best candidate which will gain the focus.
9
+
You can check the result of element.spatNavSearch() as 'border-color'.">
Copy file name to clipboardExpand all lines: demo/sample/heuristic_iframe.html
+1-2
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,8 @@
8
8
<metaname="description" content="The iframe Element is considered as a container that can give priority to the internal elements in spatial navigation. You can test spatial navigation behavior in the iframe element using arrow keys.">
<metaname="description" content="The iframe Element is considered as a container that can give priority to the internal elements in spatial navigation. You can test spatial navigation behavior in the iframe element using arrow keys.">
This is a <ahref="https://github.com/WICG/spatial-navigation" target="blink">repository</a> for making the Web excellently embrace the
21
+
<ahref="https://wicg.github.io/spatial-navigation/" target="blink">spatial navigation</a>'s features so that
22
+
the Web technology can be propagated into <ahref="https://www.merriam-webster.com/dictionary/several" target="blink">several</a> industries such as TV, IVI, game console,
23
+
and upcoming smart devices as well as PC and mobile for <ahref="https://a11yproject.com/" target="blink">a11y</a>.
24
+
25
+
<h3>Details</h3>
26
+
<ol>
27
+
<li>Read the <ahref="https://github.com/WICG/spatial-navigation/blob/master/explainer.md" target="blink">Explainer</a></li>
28
+
<li>Read the <ahref="https://wicg.github.io/spatial-navigation/" target="blink">Spec</a></li>
29
+
<li>See the <ahref="https://github.com/WICG/spatial-navigation/blob/master/implStatus.md" target="blink">Implementation Status</a></li>
30
+
<li>Try the <ahref="https://wicg.github.io/spatial-navigation/demo/" target="blink">Demo</a></li>
31
+
<li>Give feedback on <ahref="https://github.com/WICG/spatial-navigation/issues" target="blink">issues</a></li>
32
+
</ol>
33
+
34
+
<h3>Overview</h3>
35
+
36
+
Spatial navigation (aka Spatnav) is the ability to navigate between focusable elements based on their position
37
+
within a structured document. Spatial navigation is often called 'directional navigation'
38
+
which enables four(4) directional navigation. Users are usually familiar with the 2-way navigation
39
+
using tab key for the forward direction and shift+tab key for the backward direction,
40
+
but not familiar with the 4-way navigation using arrow keys.
41
+
Regarding TV remote control, game console pad, IVI jog dial with 4-way keys, and
42
+
Web accessibility, the spatial navigation has been a rising important input mechanism in several industries.
43
+
If the Web can embrace the spatial navigation and efficiently support the functionalities in Web engines and W3C APIs,
44
+
it will be more promising technology for existing products as mentioned above and various upcoming smart devices.
Users can now user the keyboard's arrow keys to navigate the page.
56
86
57
-
### Handling <code>keydown</code> event
58
-
In the polyfill, <ahref="https://www.w3.org/TR/DOM-Level-3-Events/#event-type-keydown"><code>keydown</code> event</a> triggers the spatial navigation.
59
-
Also, the <code>keydown</code> event handler is attached to the window object.
87
+
### Handling Browser Events
88
+
In the polyfill, <ahref="https://www.w3.org/TR/DOM-Level-3-Events/#event-type-keydown"><code>keydown</code> event</a> and <ahref="https://www.w3.org/TR/DOM-Level-3-Events/#event-type-mouseup"><code>mouseup</code> event</a> are used for the spatial navigation.
89
+
The event handlers of those are attached to the window object.
60
90
61
91
We recommend to use it with the polyfill as below:
62
92
63
-
* If you want to use the <code>keydown</code> event handler for other usages besides the spatial navigation,
93
+
* If you want to use those event handlers for other usages besides the spatial navigation,
64
94
* attach the event handler on the children of window object
65
95
or
66
96
* call the event handler during the capturing phase of the event.
67
-
* If you don't want the <code>keydown</code> event work with the spatial navigation, call <code>preventDefault()</code> for it.
97
+
* If you don't want those events work with the spatial navigation, call <code>preventDefault()</code>.
0 commit comments