xamarin/Xamarin.Forms

Scrollview: Scrollability of nested scrollviews broken if gesture recognizer added

Aperta

#6513 aperta il 13 giu 2019

 (1 commento) (0 reazioni) (0 assegnatari)C# (1926 fork)batch import
3.5.0a/gestures 🖖e/5 :clock5:help wantedi/regressionp/Androidt/bug :bug:up-for-grabs

Metriche repository

Star
 (5644 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Description

Nested Scrollvies + GestureRecognizer: ScrollView dont scroll anymore:

    <ScrollView
        HorizontalOptions="FillAndExpand"
        VerticalOptions="FillAndExpand"
        Orientation="Vertical">

        <StackLayout
	        HorizontalOptions="FillAndExpand"
	        VerticalOptions="FillAndExpand">

	        <ScrollView
		        Orientation="Horizontal"
		        HorizontalOptions="FillAndExpand"
		        VerticalOptions="Start">

		        <StackLayout
    				WidthRequest="3000"
        			HeightRequest="200"
	        		BackgroundColor="Aqua"/>
	        </ScrollView>

    		<StackLayout
        		HorizontalOptions="FillAndExpand"
	        	HeightRequest="800"
		        BackgroundColor="Fuchsia">
    			<StackLayout.GestureRecognizers>
        			<TapGestureRecognizer />
	        	</StackLayout.GestureRecognizers>
    		</StackLayout>
    	</StackLayout>
    </ScrollView>

Steps to Reproduce

  1. open app
  2. scroll the fuchsia scrollview (vertical) up & down -> works
  3. scroll the upper (horizontal) scrollview left & right -> works
  4. after that, scroll the fuchsia scrollview (vertical) again -> doesn't work

Expected Behavior

Vertical scrollview should scroll

Actual Behavior

Vertical scrollview doesn't scroll

Basic Information

  • Version with issue: >= 3.5
  • Last known good version: 3.4
  • IDE: Visual Studio 2019
  • Platform Target Frameworks: Android
    • Android: 9.0
  • Android Support Library Version: v28.0.0.1
  • Nuget Packages: standard
  • Affected Devices: all

Seems that the update of Xamarin.Forms.Core.IScrollViewController.cs and Xamarin.Forms.Core.ScrollView.cs (LayoutAreaOverride) causes the issues.

Reproduction Link

ScrollIssue.zip

Guida contributor