Skip to content

Commit ec9ac99

Browse files
author
Jihye Hong
committed
[css-nav-1] Modify the sample code in examples
1 parent d07411e commit ec9ac99

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

css-nav-1/Overview.bs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ and the result will be <code>null</code>.</em>
565565
recursively.
566566

567567
<pre><code highlight=javascript>
568-
document.addEventListener('navbeforefocus', function(e) {
568+
document.addEventListener('navbeforefocus', e => {
569569
e.preventDefault();
570570

571571
let target = e.relatedTarget;
@@ -574,10 +574,7 @@ and the result will be <code>null</code>.</em>
574574

575575
if (areas.length === 0) { break; }
576576

577-
target = target.spatialNavigationSearch({
578-
dir: e.dir,
579-
candidates: areas
580-
});
577+
target = target.spatialNavigationSearch(e.dir, { candidates: areas });
581578
}
582579
target.focus();
583580
});
@@ -597,7 +594,7 @@ and the result will be <code>null</code>.</em>
597594
or programmatic calls to {{focus()}}
598595

599596
<pre><code highlight=javascript>
600-
document.addEventListener('navnotarget', function(e) {
597+
document.addEventListener('navnotarget', e => {
601598
e.preventDefault();
602599

603600
const container = e.relatedTarget;
@@ -619,10 +616,7 @@ and the result will be <code>null</code>.</em>
619616
break;
620617
}
621618
} else {
622-
const target = container.spatialNavigationSearch({
623-
dir: e.dir,
624-
candidates: areas
625-
});
619+
const target = container.spatialNavigationSearch(e.dir, { candidates: areas });
626620
target.focus();
627621
}
628622
});

0 commit comments

Comments
 (0)