-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with useBeforeUnload
on iOS Safari
#7
Comments
I'm fine with switching to a hook like that provided it works for other browsers still. Thanks! |
Knowing you're also involved in the react-router / remix projects, would you prefer to push for |
We'll see what the team says! https://x.com/kentcdodds/status/1792931607537467871 |
Team's not keen on exposing that hook (for good reasons) so I just switched to a simple |
🎉 This issue has been resolved in version 1.1.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
I see, I remember reading a PR comment but I guess the decision wasn't made public. Totally makes sense though, thanks for the quick fix! Appreciate your work a lot. |
I've been noticing that
ElementScrollRestoration
does not work on iOS Safari, or at least not reliably. I could pinpoint the issue touseBeforeUnload
not being triggered due towindow.onbeforeunload
not being supported. There have been similar reports forreact-router-dom
(remix-run/react-router#9463), which have been fixed by switching to listening towindow.pagehide
(remix-run/react-router#9945). Monkey patching or rather just forkingElementScrollRestoration
and adding and using theusePageHide
hook fixes these problems for me. If this is a known bug that does not only affect me for some reason, I'd be happy to help out with a pull request.The text was updated successfully, but these errors were encountered: