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 Mar 23, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 23, 2026. It is now read-only.
Let's add a container-attribute to NavigationEvent?
It will default to document.body unless spatnav-container imposed a restriction on the search.
When dispatching the event, the browser has this information at hand already, so why not share this possibly important piece of information to authors?
In navnotarget and navbeforescroll※ it is included already in relatedTarget.
What would you suggest we put in relatedTarget for navnotarget and navbeforescroll if there was a separate container attribute? The same information? null?
※ In the case of navbeforescroll, relatedTarget is described as the thing you scroll, but that's a spatnav container anyway, so it's just a matter of how you look at it. The info is there.
It will default to document.body unless spatnav-container imposed a restriction on the search.
Or unless there's a scroller in the ancestry chain, since this create spatnav containers as well.
I didn't think of that. But I realized, I think nextFocus is a better name than relatedTarget, see #34.
What would you suggest we put in relatedTarget for navnotarget and navbeforescroll if there was a separate container attribute? The same information? null?
Yes, maybe null is fine? That's a hint that nothing will be focused?
It will default to document.body unless spatnav-container imposed a restriction on the search.
Or unless there's a scroller in the ancestry chain, since this create spatnav containers as well.
Right. Good point. Scrollers that "jail" the focused element would be reported in container as well. Chromium's current spatnav algorithm happily exits scrollers, so today scrollers don't impose any restrictions. This is something I'd like to see fixed by first focusing the scroller.
Activity
frivoal commentedon Feb 21, 2018
In
navnotargetandnavbeforescroll※ it is included already inrelatedTarget.What would you suggest we put in
relatedTargetfornavnotargetandnavbeforescrollif there was a separatecontainerattribute? The same information?null?※ In the case of
navbeforescroll,relatedTargetis described as the thing you scroll, but that's a spatnav container anyway, so it's just a matter of how you look at it. The info is there.Or unless there's a scroller in the ancestry chain, since this create spatnav containers as well.
hugoholgersson commentedon Feb 21, 2018
I didn't think of that. But I realized, I think
nextFocusis a better name thanrelatedTarget, see #34.Yes, maybe
nullis fine? That's a hint that nothing will be focused?Right. Good point. Scrollers that "jail" the focused element would be reported in
containeras well. Chromium's current spatnav algorithm happily exits scrollers, so today scrollers don't impose any restrictions. This is something I'd like to see fixed by first focusing the scroller.hugoholgersson commentedon Mar 14, 2018
Finding the parent scroller, i.e. the element's "container", can be done in standard JS [1] [2].