UX: Do not anchor scroll on topic navigation/map (#30580)

topic-navigation and topic-map appear in the DOM before the post stream, and are then rearranged with CSS grid. That means that, if they are entirely within the viewport, and does not have a fixed/sticky position, then they will be chosen as the browser's scroll anchor point.

We never want these elements to be used as the anchor, so we can set `overflow-anchor: none`.

https://meta.discourse.org/t/344386/16
This commit is contained in:
David Taylor 2025-01-06 10:13:29 +00:00 committed by GitHub
parent a15164431b
commit 486ff2a564
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View File

@ -40,6 +40,10 @@
Without this those themes would render topics unreadable. */
}
.topic-navigation {
overflow-anchor: none;
}
// timeline
@media screen and (min-width: 925px) {
// at 925px viewport width and above the timeline is visible (see topic-navigation.js)

View File

@ -44,6 +44,7 @@ body:not(.archetype-private_message) {
(var(--topic-body-width-padding) * 2)
);
padding-block: 0.5em;
overflow-anchor: none;
@include breakpoint(mobile-large) {
font-size: var(--font-down-1);