scroll-behavior: smooth
interacts poorly with MultimediaViewer
#355
Labels
bug
Something isn't working
scroll-behavior: smooth
interacts poorly with MultimediaViewer
#355
When the mmv lightbox closes, it scrolls back to the original place in the page, as if the lightbox were an overlay.
With
html { scroll-behavior: smooth }
, this scroll becomes visible and jarring.Ideally there'd be a class to select against, e.g.
html.citizen-animations-ready:not(.mw-mmv-lightbox-open) { scroll-behavior: smooth; }
, but unfortunately the relevant handler in the MultimediaViewer code is:So the selector is removed before the scroll, and it's set to
body
, nothtml
.Injecting some addClass and removeClass calls to the function in the setTimeout works, but I don't know a way to do this cleanly (i.e. without changing the MultimediaViewer code). The following somewhere seems to work, but I don't know where it'd go, and has an obviously flimsy race condition:
The text was updated successfully, but these errors were encountered: