Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a container-field to NavigationEvent #33

Closed
hugoholgersson opened this issue Feb 19, 2018 · 3 comments
Closed

Add a container-field to NavigationEvent #33

hugoholgersson opened this issue Feb 19, 2018 · 3 comments
Labels
closed:rejected Suggestion rejected by the editors topic:spec type:enhancement Feature requests

Comments

@hugoholgersson
Copy link

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?

@frivoal
Copy link
Collaborator

frivoal commented Feb 21, 2018

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.

@hugoholgersson
Copy link
Author

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.

@hugoholgersson
Copy link
Author

Finding the parent scroller, i.e. the element's "container", can be done in standard JS [1] [2].

@frivoal frivoal added type:enhancement Feature requests topic:spec closed:rejected Suggestion rejected by the editors labels Apr 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed:rejected Suggestion rejected by the editors topic:spec type:enhancement Feature requests
Projects
None yet
Development

No branches or pull requests

2 participants