Skip to content
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

Specifying HeightRequest in Webview when wrapped by ScrollView set "invisible" causes crash in iOS #26795

Open
bobwhitten opened this issue Dec 24, 2024 · 3 comments
Labels
area-controls-scrollview ScrollView platform/iOS 🍎 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@bobwhitten
Copy link

Description

e.g., Add this to MAUI template project:

            <ScrollView x:Name="myMediaFrame" 
                IsVisible="False"
                >
                <WebView x:Name="myWebView" 
                    HeightRequest="1000"
                    />
            </ScrollView>

This results in this on startup (in my app, when the page appeared):

ObjCRuntime.ObjCException
Message=Objective-C exception thrown. Name: CALayerInvalidGeometry Reason: CALayer position contains NaN: [22 nan]. Layer: <CALayer:0x30034e780; position = CGPoint (0 0); bounds = CGRect (0 0; 0 0); delegate = <Microsoft_Maui_Platform_MauiWKWebView: 0x11640b000; frame = (0 0; 0 0); backgroundColor = UIExtendedGrayColorSpace 0 0; layer = <CALayer: 0x30034e780>>; sublayers = (<CALayer: 0x300376cc0>); allowsGroupOpacity = YES; backgroundColor = <CGColor 0x30266d9a0> [<CGColorSpace 0x30211e580> (kCGColorSpaceICCBased; kCGColorSpaceModelMonochrome; Generic Gray Gamma 2.2 Profile; extended range)] ( 0 0 )>

Removing EITHER IsVisible="False" from VerticalStackLayout OR HeightRequest="1000" from WebView prevents crash.

This behavior did not happen in Windows.
This particular behaviour does not slow me down, but it was certainly unexpected, and took some time to find.

Steps to Reproduce

Run reproduction project. Observe crash.
Modify as noted above, observe no crash.

Link to public reproduction project repository

https://github.com/bobwhitten/DemoWebView

Version with bug

9.0.21 SR2.1

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

iPadOS 18.2, 17.5.1

Did you find any workaround?

Either do not start Invisible, or do not set height request.

Relevant log output

@bobwhitten bobwhitten added the t/bug Something isn't working label Dec 24, 2024
@Ying-6
Copy link

Ying-6 commented Dec 24, 2024

Since the project linked by the user cannot be opened, I used the MAUI template project and verified this issue with Visual Studio 17.13.0 Preview 2.1 (9.0.21 & 9.0.14 & 8.0.100). Can repro this issue on iOS platform.
Image
MauiApp9.zip

@Ying-6 Ying-6 added s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage platform/iOS 🍎 labels Dec 24, 2024
@bobwhitten
Copy link
Author

Apologies, the GitHub proj was private. It is now public. Thanks to Ying-6 for pointing this out.

@PureWeen
Copy link
Member

I'm curious if this will be resolved by
#26763

@PureWeen PureWeen added this to the Backlog milestone Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-scrollview ScrollView platform/iOS 🍎 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants