Skip to content

Issues with useBeforeUnload on iOS Safari #7

@marhaupe

Description

@marhaupe

I've been noticing that ElementScrollRestoration does not work on iOS Safari, or at least not reliably. I could pinpoint the issue to useBeforeUnload not being triggered due to window.onbeforeunload not being supported. There have been similar reports for react-router-dom (remix-run/react-router#9463), which have been fixed by switching to listening to window.pagehide (remix-run/react-router#9945). Monkey patching or rather just forking ElementScrollRestoration and adding and using the usePageHide 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions