Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.
This repository was archived by the owner on Mar 23, 2026. It is now read-only.

Add a container-field to NavigationEvent #33

Closed

Description

@hugoholgersson

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?

Activity

  1. frivoal commented on Feb 21, 2018

    @frivoal
    Collaborator

    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.

  2. hugoholgersson commented on Feb 21, 2018

    @hugoholgersson
    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.

  3. hugoholgersson commented on Mar 14, 2018

    @hugoholgersson
    Author

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

  4. added
    type:enhancement
    closed:rejected
    on Apr 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    closed:rejectedtopic:spectype:enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions