Steffen
Well-known member
- Affected version
- 2.2.7
How to reproduce:
What actually happens: The browser scrolls back to the anchor link. This is annoying in particular when you've opened a thread via an "unread" link and then (after you've read all unread posts) reload the page to see whether further replies have arrived.
This issue doesn't affect Chrome Desktop (don't know why) but it affects Firefox Desktop and Safari Desktop. On mobile it affects Chrome, too (haven't tested other browsers).
Originally reported here: https://www.computerbase.de/forum/threads/automatisches-setzen-eines-ankers-in-einem-thread.2053585/
I can fix this issue by removing the call to "XF.pageLoadScrollFix" in core.js. Its purpose seems to be to fix the scroll position after post-load layout-shift has happened. Since layout shift caused by images has been fixed I think the only layout shift remaining in XenForo is caused by embeds, right? Video embeds in particular should be fine because their aspect ratio is known a priori, probably the main remaining issue are Twitter embeds. And maybe in modern browsers scroll anchoring takes care of the remaining cases automatically? So maybe "XF.pageLoadScrollFix" is not needed anymore?
- Open a XenForo page with an anchor link: https://xenforo.com/community/threa...importers-1-5-1-released.198197/#post-1538490
- Scroll up or down a bit (away from the anchor link)
- Reload the page
What actually happens: The browser scrolls back to the anchor link. This is annoying in particular when you've opened a thread via an "unread" link and then (after you've read all unread posts) reload the page to see whether further replies have arrived.
This issue doesn't affect Chrome Desktop (don't know why) but it affects Firefox Desktop and Safari Desktop. On mobile it affects Chrome, too (haven't tested other browsers).
Originally reported here: https://www.computerbase.de/forum/threads/automatisches-setzen-eines-ankers-in-einem-thread.2053585/
I can fix this issue by removing the call to "XF.pageLoadScrollFix" in core.js. Its purpose seems to be to fix the scroll position after post-load layout-shift has happened. Since layout shift caused by images has been fixed I think the only layout shift remaining in XenForo is caused by embeds, right? Video embeds in particular should be fine because their aspect ratio is known a priori, probably the main remaining issue are Twitter embeds. And maybe in modern browsers scroll anchoring takes care of the remaining cases automatically? So maybe "XF.pageLoadScrollFix" is not needed anymore?