-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Selecting a link in a WebView on iOS causes a NSInternalInconsistencyException #17923
Comments
Having an identical issue using the built-in MAUI WebView control on iOS (.NET 7). Found two workarounds:
I had already implemented my own custom handler, so I implemented both fixes above, just in-case. |
Verified this issue with Visual Studio Enterprise 17.10 Preview 1.0, not repro on .NET 8.0 iOS platform with sample project. |
Hi @edgarssults. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version. You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
Reproduced with Visual Studio 17.9.2, net8.0-ios, MAUI 8.0.7. |
Description
Selecting any link in a WebView by pressing and holding always causes a crash on iOS.
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Completion handler passed to -[Microsoft_Maui_Platform_MauiWebViewUIDelegate webView:contextMenuConfigurationForElement:completionHandler:] was not called'
There seems to be a problem with how the context menu is configured by MAUI. The problematic code is apparently here.
It works fine on Android. Selecting normal text also works fine and the context menu appears.
Related issue: #11544
Steps to Reproduce
Actual behavior:
App crashes.
Expected behavior:
Link or part of the link is selected and a context menu appears.
Link to public reproduction project repository
https://github.com/edgarssults/maui-ios-crash
Version with bug
7.0.92
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iOS 17.0.3
Did you find any workaround?
Creating a custom
WebViewHandler
that initializes a custom WebView on iOS whereAllowsLinkPreview
is set to false prevents this crash.Relevant log output
The text was updated successfully, but these errors were encountered: