xamarin/Xamarin.Forms

[Bug][Android] Vertical ScrollView can't scroll after scrolling a nested horizontal ScrollView

Open

#8,879 opened on Dec 13, 2019

 (8 comments) (2 reactions) (0 assignees)C# (1,926 forks)batch import
e/5 :clock5:help wantedp/Androidt/bug :bug:up-for-grabs

Repository metrics

Stars
 (5,644 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Description

On Android devices only, you can't scroll a vertical ScrollView anymore after scrolling a nested horizontal ScrollView, when panning on entries. If you don't scroll the nested horizontal scrollview, you can scroll vertically, even if you put your finger on entries. After scrolling vertically, starting from the horizontal scrollview (if you put your finger on the nested horizontal scrollview), the issue disappears : you can scroll back vertically if you put your finger on entries. If my explanaitions aren't clear enough, please check the GIF below to see how it behaves.

Steps to Reproduce

  1. Clone https://github.com/EmmanuelJego/XFormsNestedScrollBug.git and launch the app, or create your own ContentPage with a vertical scrollview with a nested horizontal scrollview, and add entriy(ies) to the vertical one.
  2. First, scroll the vertical scrollview (up or down) (you can start scrolling from a light gray box or an entry, both work as expected).
  3. Then, scroll the horizontal scrollview (left or right) (the one with small darker gray boxes in my sample). No problem so far.
  4. Now, try to scroll the vertical scrollview again (up or down) (without starting scrolling from the dark gray boxes, otherwise the bug wouldn't show up, as explained in 5th step) : if you start scrolling from a light gray box, it works as expected, just as before. But then if you try to scroll starting from an entry, it doesn't scroll down nor up. It looks like the scrollview looses the focus.
  5. If you want the vertical scrollview to work back again, start scrolling vertically starting from the horizontal scrollview (put your finger on a dark gray box, and scroll up or down) : then, the bug disappears.

Expected Behavior

The parent vertical scrollview scrolls normally, even after scroll the nested horizontal scrollview.

Actual Behavior

The parent vertical scrollview doesn't scroll after scrolling the nested horizontal scrollview, only if you start the vertical scrolling from an entry.

Basic Information

  • Version with issue: Xamarinf.Forms 4.4.0.991265
  • Tested Android devices/versions:
    • Moto G5 / Android 7.0
    • Samsung Galaxy S10e / Android 9.0
    • Xiaomi Mi 9t / Android 9.0
    • Samsung Galaxy Tab A (tablet) / Android 7.1
    • Android emulator 9.0
    • Android emulator 6.0

Screenshots

20191213_103353

Reproduction Link

https://github.com/EmmanuelJego/XFormsNestedScrollBug.git

Contributor guide