Xamarin.Forms icon indicating copy to clipboard operation
Xamarin.Forms copied to clipboard

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

Open vsfeedback opened this issue 5 years ago • 11 comments

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)

vsfeedback avatar May 29 '19 22:05 vsfeedback

This would probably be resolved by #2680

samhouts avatar May 29 '19 22:05 samhouts

Same problem here

jrahma avatar Nov 09 '19 17:11 jrahma

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

tentom avatar Jun 16 '20 09:06 tentom

#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;

tyagishubham177 avatar Jun 18 '20 04:06 tyagishubham177

Not working on Android

jrahma avatar Aug 07 '20 17:08 jrahma

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

<ScrollView>
    <WebView>
        <WebView.Source>
            <HtmlWebViewSource Html="{Binding MyHTMLText}" />
        </WebView.Source>
    </WebView>
</ScrollView>

pmahend1 avatar Oct 30 '20 01:10 pmahend1

Still no luck!

jrahma avatar Feb 02 '21 19:02 jrahma

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 !

inshalirshad avatar Mar 28 '21 19:03 inshalirshad

Any progress on that issue?

SergTomcat avatar Sep 22 '21 15:09 SergTomcat

Any resolution for this?

pooran avatar May 20 '22 10:05 pooran

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.

Adrianotiger avatar Dec 11 '23 08:12 Adrianotiger