Conversation
Contributor
There was a problem hiding this comment.
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()
jsuarezruiz
marked this pull request as draft
March 20, 2025 11:13
jsuarezruiz
commented
Mar 20, 2025
jsuarezruiz
marked this pull request as ready for review
May 8, 2025 15:57
mattleibow
requested changes
May 13, 2025
rmarinho
requested changes
May 28, 2025
rmarinho
left a comment
Member
There was a problem hiding this comment.
Seems tests are failing
/_/src/BlazorWebView/src/Maui/iOS/IOSWebViewManager.cs(16707566): error MT4174: Unable to locate the block to delegate conversion method for the method System.Void Microsoft.AspNetCore.Components.WebView.Maui.IOSWebViewManager/WebViewUIDelegate::RunJavaScriptTextInputPanelWithPrompt(WebKit.WKWebView,Foundation.NSString,Foundation.NSString,WebKit.WKFrameInfo,System.Action`1<Foundation.NSString>)'s parameter #5. [/Users/builder/azdo/_work/_temp/test-dir/BuildWithDiffer1382439389/BuildWithDiffer1382439389.csproj::TargetFramework=net10.0-maccatalyst]
Contributor
Author
Should be fixed with the latest changes. |
rmarinho
previously approved these changes
Jun 5, 2025
Member
|
/rebase |
github-actions
Bot
force-pushed
the
fix-28135
branch
from
June 5, 2025 16:58
79e7dd8 to
3548fcb
Compare
mattleibow
reviewed
Jun 5, 2025
mattleibow
requested changes
Jun 5, 2025
mattleibow
left a comment
Member
There was a problem hiding this comment.
The magic is to use the fancy code from dotnet/macios#15728 (comment)
Right now this PR still throws if null is used.
I'll update
mattleibow
approved these changes
Jun 5, 2025
dalexsoto
approved these changes
Jun 5, 2025
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description of Change
This pull request introduces several enhancements and fixes across the Maui platform, focusing on improving iOS support, adding new functionality to Blazor components, and refining public APIs. Key changes include enabling unsafe code blocks, extending iOS-specific features, and adding user interaction capabilities in Blazor components.
Changes to iOS-specific functionality:
UIApplicationExtensionspublic and addedGetKeyWindowandGetWindowextension methods to simplify window management in iOS. (src/Core/src/Platform/iOS/UIApplicationExtensions.cs,src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt,src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt) [1] [2] [3]IOSWebViewManagerto useGetKeyWindowinstead of deprecatedUIApplication.Windowsfor compatibility with iOS 15+ and introducedActionStringTrampolineBlockfor handling unmanaged function pointers. (src/BlazorWebView/src/Maui/iOS/IOSWebViewManager.cs) [1] [2]Enhancements to Blazor components:
DecrementandSet Value) to the Blazor sample app, enabling user interactions with JavaScript for confirmation dialogs, prompts, and alerts. (src/Controls/samples/Controls.Sample/Pages/Blazor/Index.razor)Build and project settings:
AllowUnsafeBlocksproperty in theMicrosoft.AspNetCore.Components.WebView.Maui.csprojfile to allow unsafe code usage. (src/BlazorWebView/src/Maui/Microsoft.AspNetCore.Components.WebView.Maui.csproj)These changes improve compatibility, enhance functionality, and refine user interactions within the Maui platform and Blazor components.
Issues Fixed
Fixes #28135