-
Notifications
You must be signed in to change notification settings - Fork 106
Closed
Labels
needs triageThis issue has not been triaged by maintainersThis issue has not been triaged by maintainers
Description
Describe the bug
The hash plugin sets scrollRestoration to "manual" when opening Fancybox, which causes the page always jumps to the top of the page after F5 (reload) - because browser does not remember the scroll position.
It should re-set it to "auto" on onClose event IMHO.
Reproduction
- Place the gallery outside the first viewport.
- Scroll down to the gallery.
- Refresh the page—the browser will leave you at this position.
- Open Fancybox.
- Close Fancybox.
- Reload the page—the browser will scroll to the top.
Additional context
This setting remains active even after hard reloading the page — scrollRestoration is not reset, it remains at the current history entry. The browser will not natively restore the scroll when reloading because "manual" prevents it from doing so. Default scrollRestoration value is only restored after opening the page in a new tab/window.
So just opening Fancybox will "destroy" the browser's behavior for all other pages visited in the same browser window.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
needs triageThis issue has not been triaged by maintainersThis issue has not been triaged by maintainers