ditdot-dev/vue-flow-form

Bug: Refreshing on a mobile browser does not show warning prompt and causes data to be lost

coxlr opened this issue · 2 comments

coxlr commented

Describe the bug
When you refresh the page using a mobile browser after the first question it does not show warning prompt and therefore refreshes and data is lost.
This happens If you use pull to refresh using chrome mobile browser, or using the refresh button in the URL bar on Safari and FireFox

To Reproduce
Take a survey on a mobile device and answer the first question, this will take you to the next question. If you refresh/reload the page it will not show a warning prompt and will lose your data.

Expected behavior
If on any question apart from the first one and the page is refreshed/reloaded, it should prompt and warn the user that their data will be lost if they continue, and give them the option to cancel.

Screenshots
Here is a video showing what currently happens on Chrome when you pull to refresh on the second question.

RPReplay_Final1633041777.MP4

Here is a video showing what currently happens on Safari when you click the reload button in the URL bar.

RPReplay_Final1633041819.MP4

Desktop (please complete the following information):

  • Device: iPhone 12mini
  • OS: iOS
  • Browser Chrome, Safari and FireFox
  • Version: latest version of each
spinn commented

Hi @coxlr,

we are using a standard implementation of the beforeunload event, although we are not quite sure about iOS support for this event. If you know of a solution that reliably works on iOS let us know and we'll consider implementing it.

coxlr commented

I spent time looking in to and researching all the various options for this prior to raising the issue. Unfortunately I was also unable to find and implement a working solution for iOS