You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When used concurrently with Hugo Easy Gallery in a Hugo site, scroll position on the page will be reset after viewing an image.
Expected behavior
Open an image in Hugo Easy Gallery, then close it, and your scroll position should be remembered.
Examples Example site with the bug (use hugo serve -D)
If you want the latest Hugo Easy Gallery code, here is my fork, which has updates and PRs merged.
Environment
Used Operating System(s): Win10 v1709
Used Browser(s) (with version): Ungoogled Chromium v90
The text was updated successfully, but these errors were encountered:
I was also wondering how I could go about removing OverlayScrollbars from my site, as a temporary workaround for this incompatibility. However, removing it via a conditional statement in my site's config.toml (and requisite edits in the site's theme code) to disable OverlayScrollbars JS/CSS breaks the site's sticky header function.
I tried figuring out how to stub the JS so that minimal function remains to support the sticky header, but with regular scrollbars, but haven't had any luck.
// To Remember scroll position before opening image
var scrollPosition = window.scrollY;
// Open image in Hugo Easy Gallery
// ...
// To Restore scroll position after closing image
window.scrollTo(0, scrollPosition);
JS code to use the regular scrollbars:
// Get the header element
var header = document.querySelector('header');
// Get the height of the header
var headerHeight = header.offsetHeight;
// Add a class to the header when the user scrolls down
window.addEventListener('scroll', function() {
if (window.scrollY > headerHeight) {
header.classList.add('sticky');
} else {
header.classList.remove('sticky');
}
});
Describe the bug
When used concurrently with Hugo Easy Gallery in a Hugo site, scroll position on the page will be reset after viewing an image.
Expected behavior
Open an image in Hugo Easy Gallery, then close it, and your scroll position should be remembered.
Examples
Example site with the bug (use
hugo serve -D
)If you want the latest Hugo Easy Gallery code, here is my fork, which has updates and PRs merged.
Environment
The text was updated successfully, but these errors were encountered: