diff --git a/CHANGELOG.md b/CHANGELOG.md index c50df58..bec90cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Fixes + +- Fixes an issue where dismissing an alert view triggered the onBrowserClosed event. [RMET-4500](https://outsystemsrd.atlassian.net/browse/RMET-4500). + ## 2.2.0 ### Features diff --git a/Sources/OSInAppBrowserLib/RouterAdapters/OSIABWebViewRouterAdapter.swift b/Sources/OSInAppBrowserLib/RouterAdapters/OSIABWebViewRouterAdapter.swift index 0a5ab4b..fd3c521 100644 --- a/Sources/OSInAppBrowserLib/RouterAdapters/OSIABWebViewRouterAdapter.swift +++ b/Sources/OSInAppBrowserLib/RouterAdapters/OSIABWebViewRouterAdapter.swift @@ -121,10 +121,14 @@ private class OSIABWebViewController: UIHostingController Void)? = nil) { - super.dismiss(animated: flag, completion: { + guard presentedViewController == nil else { + return super.dismiss(animated: flag, completion: completion) + } + + super.dismiss(animated: flag) { self.dismiss?() completion?() - }) + } } }