xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.62k stars 1.87k forks source link

Xamarin Forms: WebView in a ScrollView - Can't scroll webview content because scrollview grabs the gesture #6351

Open vsfeedback opened 5 years ago

vsfeedback commented 5 years ago

VSF_TYPE_MARKDOWN`XML <ScrollView x:Name="masterScroll" HorizontalOptions="StartAndExpand" VerticalOptions="StartAndExpand" BackgroundColor="Fuchsia"> <!--#region Limited web browser with authentication--> <controls:AuthWebView x:Name="Browser" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" HeightRequest="750" BackgroundColor="SaddleBrown" Navigated="Browser_NavigationDone" Navigating="Browser_NavigationStarting" Password="admin" ShouldTrustUnknownCertificate="True" Source="{Binding BrowserAddy}" Username="admin" /> </ScrollView>

So... If you navigate to a page that has some scrolling content... Anything with a scroll control such as this very page with a scrolling text editor... You can't scroll the scrollable content in the WebView because the encasing ScrollView grabs all the tap guesture, no matter where you touch.

I would expect, that if you are trying to scroll over a scrollable area then the gesture falls through. If you try to scroll and the control below is not capable of taking the gesture, then the parent gesture uses it. IE: Try to scroll over a Text box or list of some type should scroll the webview content. Try to scroll anywhere else on the page, and it should move the ScrollView

Does that make sense?

This issue has been moved from https://developercommunity.visualstudio.com/content/problem/482341/xamarin-forms-webview-in-a-scrollview-cant-scroll.html VSTS ticketId: 814933 These are the original issue comments:

Visual Studio Feedback System on 3/7/2019, 06:23 PM (82 days ago):

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Samantha Houts [MSFT] on 3/11/2019, 04:33 PM (78 days ago):

Thank you for sharing your feedback! Our teams prioritize action on product issues with broad customer impact.See details at: https://docs.microsoft.com/en-us/visualstudio/ide/report-a-problem?view=vs-2017#faq . In case you need answers to common questions or need assisted support, be sure to use https://visualstudio.microsoft.com/vs/support/ . We'll keep you posted on any updates to this feedback.


Your report will be tracked on https://github.com/xamarin/Xamarin.Forms/issues .

These are the original issue solutions: (no solutions)

samhouts commented 5 years ago

This would probably be resolved by #2680

jrahma commented 4 years ago

Same problem here

tentom commented 4 years ago

A webView in a scrollView seems to work on iOS but not on Android.

tyagishubham177 commented 4 years ago

2680 is resolved but the issue is still there. I have tried with following code on android but no luck

Control.RequestDisallowInterceptTouchEvent(true); Control.NestedScrollingEnabled = true;

jrahma commented 4 years ago

Not working on Android

pmahend1 commented 3 years ago

Yes. It does not work . Is there any work around?

<ScrollView>
    <WebView>
        <WebView.Source>
            <HtmlWebViewSource Html="{Binding MyHTMLText}" />
        </WebView.Source>
    </WebView>
</ScrollView>
jrahma commented 3 years ago

Still no luck!

inshalirshad commented 3 years ago

Still this issue is present.... Only a work around is for android but for IOS stills same. Expecting a fix from Xamarin. As this issue is been there from years now !

SergTomcat commented 3 years ago

Any progress on that issue?

pooran commented 2 years ago

Any resolution for this?

Adrianotiger commented 10 months ago

After 4 long years still no update? This bug is still present in Maui.

If we don't set the webview in a scrollview, the fields inside the webview are hidden by the softkeyboard. If we set the webview inside a scrollview, we are not able to scroll the webview.