afterpay / sdk-ios

Afterpay iOS SDK
https://developers.afterpay.com
Apache License 2.0
20 stars 10 forks source link

Bug: SwiftUI, swiping on modal gives no confirmation alert & page refreshes #134

Closed huwr closed 1 month ago

huwr commented 3 years ago

🌎 Environment

💬 Description

When using the SwiftUI wrapper: afterpayCheckout only, when the user attempts to dismiss the web checkout view by swiping down, it is supposed to pop up an alert view asking “Are you sure?”. It doesn't do this.

It also refreshes the page, loosing anything the user has entered, and making them log in again.

This does not appear to happen on iOS 13.

🦶 Reproduction Steps

Steps to reproduce the behaviour:

  1. Open the checkout (with SwiftUI — good example is the Example app)
  2. Swipe to dismiss

🤔 Expected Results

There should be a alert which confirms that the user wishes to dismiss

😲 Actual Results

Screenshots

https://user-images.githubusercontent.com/790199/109878580-90d34380-7cc8-11eb-98a9-8bfa53a66ef1.mov

🤝 Related Issues

A similar problem, with a potential solution, is explored here: https://stackoverflow.com/questions/56615408/prevent-dismissal-of-modal-view-controller-in-swiftui

huwr commented 3 years ago

Potentially helpful new modifier in iOS 15 b1: https://developer.apple.com/documentation/swiftui/view/interactivedismissdisabled(_:)