Repository navigation
fix(toast): show toast above presented view controllers on iOS - #2644
Open
Albermonte wants to merge 1 commit into
Open
Albermonte wants to merge 1 commit into
Albermonte wants to merge 1 commit into
Conversation
Albermonte
marked this pull request as ready for review
November 25, 2026 14:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On iOS,
Toast.show()shows nothing and resolves right away while another view controller is presented over the webview, such as@capacitor/browseror an in-app browser plugin.ToastPlugin.showalways adds the toast tobridge.viewController.view, which sits behind the presented view controller.This PR walks
presentedViewControllerfrombridge.viewControlleron the main thread and shows the toast in the topmost one, matching how@capacitor/sharepicks its presenter since #2574. The walk stops before a view controller that is being dismissed or aUIAlertController, since an alert's view is only the alert box. With nothing presented, the toast stays inbridge.viewController.Tested on an iPhone 17 simulator running iOS 27.0 using the repro from #2643, with this change applied to 8.0.1 as a pnpm patch on the
with-fixbranch.Fixes #2643