-
Notifications
You must be signed in to change notification settings - Fork 997
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
3DS adds a large amount of whitespace to every ScrollView with SwiftUI and UIViewControllerRepresentable #1761
Comments
Hi @AlexanderTheLit, I tried to reproduce this issue on an iPhone X running both 14.2 and 14.4 but have not been able to. Do you have additional screenshots, videos, and/or example projects that you could share? |
Thanks for the quick reply @csabol-stripe. Huh strange, I've included a video highlighting the issue on a iPhone XR 14.4. It only happens with the 3DS WebView, for a non 3DS SetupIntent it works perfectly. I have also included the SetupIntentViewController swift file I'm using. StripeViewController.swift.zip 3DSIssue.mp4 |
ah I am able to reproduce with your code. This also reproduces if you change the pay button to just present an SFSafariViewController instance (bypassing the Stripe SDK) It looks like this is probably an issue with SwiftUI + view controller presentation though I haven't been able to track down any similar bugs. I will leave this issue open for now because @davidme-stripe is working on some SwiftUI support and sample code now that may be able to help with this |
@AlexanderTheLit, can you try the new SwiftUI bindings in 21.3.0? We now have an |
Thanks for the reply @davidme-stripe. I integrated your code, but sadly the issue is still persisting. I think @csabol-stripe is correct, the issue lies with SwiftUI and SFSafariViewController presentation. Also not sure if I'm integrating it right, but when calling *Video below
SetupIntentIssue.mp4 |
That does look like a SwiftUI bug, unfortunately. :( Please file it via Feedback Assistant, we'll file our own report as well. As for the sheet-in-a-sheet dismissing issue, that's a bug on our end. I'll investigate a fix. |
@AlexanderTheLit @objc func pay() {
let vc = SFSafariViewController(url: URL(string: "https://www.stripe.com")!)
vc.modalPresentationStyle = .overCurrentContext
self.present(vc, animated: true, completion: nil)
} However, when using Stripe, you're not handling SFSafariViewController directly. extension SFSafariViewController{
open override var modalPresentationStyle: UIModalPresentationStyle{
get{
return .overCurrentContext
}
set {}
}
} Of course, it's hacky at best. |
Very interesting @mvarie, I just tried it and it does indeed fix the issue. To be honest I kind of like the way |
This should be fixed in 21.4.0. |
Summary
Setup Intent in a ViewController called by a UIViewControllerRepresentable in SwiftUI works great and integrates well. The only issue is that when I use 3DS the WebView causes this weird issue where large amounts of white space are added to every ScrollView in my app where buttons can't be tapped and other strangeness occurs like lists being clipped into a small rectangle.
I have included the SwiftUI portion of the code below to reproduce, as for the Setup Intent ViewController I use this code exactly https://github.com/stripe-samples/mobile-saving-card-without-payment/blob/master/client/ios/App%20(Swift)/CheckoutViewController.swift
*What's weird is that it only occurs on device. I've tried with iPhone 12, XR, and 8 plus
Code to reproduce
Use the card number 4000002500003155. Once the 3DS presents, tap fail or complete authentication. Then close the setup intent sheet and scroll down to see that the view has a large amount of whitespace below the blue Rectangle.
iOS version
IOS 14.4
Installation method
Pod
SDK version
The text was updated successfully, but these errors were encountered: