-
Notifications
You must be signed in to change notification settings - Fork 38
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
Where do we find "visible" candidates? scrollport or optimal viewing region? #29
Comments
Taking |
I guess so, but not by much, this is just using one rectangle instead of another rectangle. For now, If we have actual hit testing (which the spec currently calls for), then it may not be useful to account for However:
However, it is meant to I am thinking that:
|
It seems that BTW, both SpatNav and snapping are enabled in a web page, which one gets a higher priority? I found that one of default behavior of arrow keys would be snapping (scrolling as a unit of specified offset), so we should care this situation. I think, in this case, snapping has a higher priority than SpatNav. Back to this issue, visible candidates might be able to be found in the scrollport. |
If one arrow-key scroll step, no matter how big/small that step is, reveals focusables - then those focusables should be considered reachable = "navigable" = candidates, right? (The fact that arrow-key scrolling will stop at or continue until a scroll snap point shouldn't matter?). |
When you use the scroll snap feature, the one arrow-key scroll step doesn't change the focus. For that reason, I think it would be one of the arrow keys' default behavior, unlike just a change of the scroll offset by arrow keys. You can see the behavior where the focus is always in a document( On second thought, we could manage the focus using SpatNav in a single snap unit. If the focus is about to go outside of scrollport, the snap operation is executed at the moment, but it would have to be more investigated later. (probably level 2) FYI, Snap Points design document (Chromium) |
For example, if there is an absolutely positioned / sticky positioned banner that hides the first 50px of the scroll port, then the author should set So, with spatnav, if the element becomes focused, it will cause the scroller to scroll, in order to move it past the 50px as well. The question is: instead of focusing it while it was hidden, and scroll to make it not hidden, should the "move up" request by the user have scrolled (without focusing) instead when it was hidden, and the next "move up" would then have focused it, because it is now visible? When it is outside of the scrollport, that's what happens. I think it should probably be what happens when it is inside the scrollport but outside the optimal viewing region.
Yes, but the question is what do we mean by "reveals". Should we do it strictly on visibility? If it turns out that the "Remove from visibles items are obscured by other parts of the page" step cannot be efficiently implemented (and I think there's a real risk that that's the case, and will discuss with the csswg at the next F2F), I think it is pretty important to respect |
Instead, navigating down (resp. up, left, right) when a scroller is focused will automatically chose between * focusing the child nearest from the edge in that direction if there is any focusable child * scrolling otherwise This also removes much of the special casing needed for the root. Some ambiguities / inacuracies were resolved along the way. Closes WICG#15 Closes WICG#18 Partly relates to WICG#29
Instead, navigating down (resp. up, left, right) when a scroller is focused will automatically chose between * focusing the child nearest from the edge in that direction if there is any focusable child * scrolling otherwise This also removes much of the special casing needed for the root. Some ambiguities / inacuracies were resolved along the way. Closes WICG#15 Closes WICG#18 Partly relates to WICG#29
Instead, navigating down (resp. up, left, right) when a scroller is focused will automatically chose between * focusing the child nearest from the edge in that direction if there is any focusable child * scrolling otherwise This also removes much of the special casing needed for the root. Some ambiguities / inacuracies were resolved along the way. Closes WICG#15 Closes WICG#18 Partly relates to WICG#29 Includes an example script showing how to do focus delegation
Instead, navigating down (resp. up, left, right) when a scroller is focused will automatically chose between * focusing the child nearest from the edge in that direction if there is any focusable child * scrolling otherwise This also removes much of the special casing needed for the root. Some ambiguities / inacuracies were resolved along the way. Closes WICG#15 Closes WICG#18 Partly relates to WICG#29
Putting this on the CSSWG's F2F agenda. The key question for the CSSWG and browser implementors is: Hit testing, where you check which a element/box would be hit if you click at a certain position, or whether a particular element would be hit by clicking at a position is an existing part of the web platform. However, is the following related-but-different check is practical to implement:
The context for wanting this check is that we would like to exclude from spatial navigation elements that are hidden behind other things (like pop-over, dialogs, etc), because it is quite likely both of the following statements are true:
Stated differently, we would like to make the same elements reachable by spatnav as those that are reachable by clicking (and only those), without requiring the author to do anything in particular. If this is not possible, it seems that relying on the optimal viewing region (i.e. taking the |
In the https://wicg.github.io/spatial-navigation/#find-candidates section, we try to limit the list of candidates to visible focusable elements. Should we limit the search to the optimal viewing region (taking the
scroll-padding
property into account)?Given that the next step uses hit testing to further narrow the list, that may not be necessary. But maybe.
The text was updated successfully, but these errors were encountered: