-
Enhancement
-
Resolution: Fixed
-
P4
-
None
-
None
-
b20
-
generic
-
generic
The CSS flexbox layout introduced with JDK-8223378 has solved the problem of correct anchor scrolling with the static navigation bar, but has caused a few other problems that require workarounds, such as JDK-8249133 and follow-up bugs and now JDK-8301080.
There is another solution to the anchor positioning problem, which is to use `sticky` CSS positioning for the navigation bar then use the `scroll-margin` property defined in the CSS Scroll Snap Module 1[1] specification to position anchor links accordingly. This solution was considered at the time but not yet supported well enough in browsers. A current reevaluation of the technology shows that it is now implemented in all supported browsers[2]. A quick tests showed it working on all desktop browsers and Safari on iOS, with the only problems showing on Chrome on Android.
[1]: https://www.w3.org/TR/css-scroll-snap-1/
[2]: https://caniuse.com/?search=scroll-margin
We should consider moving from flexbox to sticky navigation + scroll-margin as soon as possible to avoid the problems and workarounds associated with the former.
There is another solution to the anchor positioning problem, which is to use `sticky` CSS positioning for the navigation bar then use the `scroll-margin` property defined in the CSS Scroll Snap Module 1[1] specification to position anchor links accordingly. This solution was considered at the time but not yet supported well enough in browsers. A current reevaluation of the technology shows that it is now implemented in all supported browsers[2]. A quick tests showed it working on all desktop browsers and Safari on iOS, with the only problems showing on Chrome on Android.
[1]: https://www.w3.org/TR/css-scroll-snap-1/
[2]: https://caniuse.com/?search=scroll-margin
We should consider moving from flexbox to sticky navigation + scroll-margin as soon as possible to avoid the problems and workarounds associated with the former.
- blocks
-
JDK-8301080 Tap on status bar to go to top of page not working on Safari on iPhone
- Closed
-
JDK-8315800 Improve layout for API Documentation on large screens
- Closed
- duplicates
-
JDK-8301080 Tap on status bar to go to top of page not working on Safari on iPhone
- Closed