-
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
[NET10] Replace the obsolete RunJavaScriptTextInputPanel #28531
base: net10.0
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR replaces the obsolete RunJavaScriptTextInputPanel with a new public API method and adds a decrement functionality in the Blazor sample page.
- Replaces the obsolete method with a new signature and updated parameter list in the iOS WebView manager.
- Removes deprecated warning suppression and updates logic for presenting the alert controller.
- Introduces a new Decrement button and corresponding logic in the Blazor sample page with a JavaScript confirmation.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/BlazorWebView/src/Maui/iOS/IOSWebViewManager.cs | Replaces obsolete RunJavaScriptTextInputPanel with new ShowJavaScriptTextInputPanel and adjusts alert controller presentation logic. |
src/Controls/samples/Controls.Sample/Pages/Blazor/Index.razor | Adds a new Decrement button with confirmation functionality via JSRuntime. |
Comments suppressed due to low confidence (1)
src/Controls/samples/Controls.Sample/Pages/Blazor/Index.razor:23
- The new Decrement method with asynchronous confirmation should be accompanied by test cases in TestCases.HostApp and TestCases.Shared.Tests.
async Task Decrement()
#pragma warning restore CS0672 // Member overrides obsolete member | ||
|
||
[Export("webView(_:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame:completionHandler:)")] | ||
public void RunJavaScriptTextInputPanelWithPrompt( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in .NET iOS we use: https://github.com/dotnet/macios/blob/29de197d989052903d126581cb768f107d256931/src/webkit.cs#L5032
that is using the deprecated method: https://developer.apple.com/documentation/webkit/webuidelegate/webview(_:runjavascripttextinputpanelwithprompt:defaulttext:initiatedby:)
The new way to go is use: https://developer.apple.com/documentation/webkit/wkuidelegate/webview(_:runjavascripttextinputpanelwithprompt:defaulttext:initiatedbyframe:completionhandler:)
Description of Change
Replace the obsolete
RunJavaScriptTextInputPanel
.Issues Fixed
Fixes #28135