Problem/Motivation

If enabled “Request Desktop Website” settings on iOS, Webform unsaved alert don’t work.

Unsaved warning confirm feature for iOS depends on browser user-agent but “Request Desktop Website” settings changes Safari's user-agent strings. So, unsaved warning script can't work.

Steps to reproduce

The iOS version is 13+ in this steps.

  1. Open Settings app from iOS home screen.
  2. Select Safari menu.
  3. Select “Request Desktop Website” from Safari settings.
  4. Enable “All Websites” settings.
  5. Install Webform module.
  6. Go to Webforms structure page.
  7. Open “Contact” form settings from operations button.
  8. Select “Form” tab.
  9. Enable “Warn users about unsaved changes” option.
  10. Access contact webform page from iOS device.
  11. Fill subject field and tap “Home” link.
  12. Go to home without warning dialog.
CommentFileSizeAuthor
#3 3174798-3.patch884 bytesjrockowitz

Comments

Tom Konda created an issue. See original summary.

jrockowitz’s picture

We might need to update the browser detection code.

@see https://stackoverflow.com/questions/58019463/how-to-detect-device-name-i...

jrockowitz’s picture

Status: Active » Needs review
StatusFileSize
new884 bytes

  • jrockowitz authored 331e654 on 8.x-5.x
    Issue #3174798 by jrockowitz: Unsaved form warning don’t work iOS Safari...
jrockowitz’s picture

Status: Needs review » Fixed

I committed the patch. Please download the latest dev release to review.

  • jrockowitz authored 331e654 on 6.x
    Issue #3174798 by jrockowitz: Unsaved form warning don’t work iOS Safari...
tom konda’s picture

Thanks @jrockowitz for your work.
Patch #3 works for me.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.