diff --git a/flutter_inappwebview_ios/ios/Classes/InAppBrowser/InAppBrowserManager.swift b/flutter_inappwebview_ios/ios/Classes/InAppBrowser/InAppBrowserManager.swift index f1cad31d..481e2a64 100755 --- a/flutter_inappwebview_ios/ios/Classes/InAppBrowser/InAppBrowserManager.swift +++ b/flutter_inappwebview_ios/ios/Classes/InAppBrowser/InAppBrowserManager.swift @@ -114,7 +114,15 @@ public class InAppBrowserManager: ChannelDelegate { assertionFailure("Failure init the visibleViewController!") return } - + + if let popover = navController.popoverPresentationController { + let sourceView = visibleViewController.view ?? UIView() + + popover.sourceRect = CGRect(x: sourceView.bounds.midX, y: sourceView.bounds.midY, width: 0, height: 0) + popover.permittedArrowDirections = [] + popover.sourceView = sourceView + } + visibleViewController.present(navController, animated: animated) }