-
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
Problem with navigating with sticky navbar, and scrolling body #151
Comments
Yes, I aware of this scenario can often happen in the real page. Step (3) - (4) is the common behavior in the spatial navigation and also the general rule of the spec. However, to solve this issue, step (4) may don't occur when the currently focused element is a sticky positioned element or descendant of a sticky positioned element. |
Hey @jihyerish Many thanks for your reply. Just to be clear, I meant that in this case when the focus is on the topmost section in the viewport, pressing up should scroll up and move the focus the section just above it instead of moving it to nav, and repeat this on up-key-presses until body has been completely scrolled. Then pressing up can move focus to nav. That I think is more intuitive from UX point of view. |
Interesting finding! Two points for your scenario.
There are several solution in your case. You can simply put the following CSS properties on the <main> element. You can also elaborate the situation by JS. Welcome more question on it, but I'm just wondering what the use case is using spatial navigation. |
Hello
Thank you very much for a much needed library/polyfill.
I have a little problem.
Code here: https://output.jsbin.com/celekuh
As you can see, once the focus moves to top section in the viewport, pressing up moves the focus to nav, and then pressing up again just scrolls the page. This might be correct according to the spec, but from UX point of view maybe is counter intuitive.
I also tried using
--spatial-navigation-contain: contain
on container wrapping the sections, however that also doesn't change anything. In this case overflow is applied on body, because otherwise scrolling is very jaggery on touch devices.Since sticky navbars are a common enough UI pattern, any ideas how I can make it work?
The text was updated successfully, but these errors were encountered: