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

Putting a GraphicsView inside a ScrollView prevents DragInteraction events on Android #7483

Open
limefrogyank opened this issue May 25, 2022 · 7 comments
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@limefrogyank
Copy link

limefrogyank commented May 25, 2022

Description

I'm trying to put a series of GraphicsView into a scrollable container, whether a plain ScrollView, ListView, or CollectionsView. I've tried all, but even with a ScrollView whose Orientation is set to Neither, I cannot receive any DragInteraction events from the GraphicsView. The StartInteraction event works and occasionally I will get one DragInteraction event, but no more.

What seems to happen is that the ScrollView or ListView just continues to scroll. It's handling all the events and not passing them down.

(On a side-note, there is no option in the GraphicsView Interaction events to implicitly handle or pass through the touch events either. This would be nice to have rather than having to subscribe/unsubscribe.)

Steps to Reproduce

  1. Create standard MAUI app.
  2. Add this:
<Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <ScrollView Orientation="Vertical">
            <StackLayout Orientation="Vertical">
                  <GraphicsView DragInteraction="OnDragHandled" HeightRequest="400" WidthRequest="300"/>
                  <GraphicsView DragInteraction="OnDragHandled" HeightRequest="400" WidthRequest="300"/>
                  <GraphicsView DragInteraction="OnDragHandled" HeightRequest="400" WidthRequest="300"/>
                  <GraphicsView DragInteraction="OnDragHandled" HeightRequest="400" WidthRequest="300"/>
                  <GraphicsView DragInteraction="OnDragHandled" HeightRequest="400" WidthRequest="300"/>
                  <GraphicsView DragInteraction="OnDragHandled" HeightRequest="400" WidthRequest="300"/>
            </StackLayout>
        </ScrollView>
</Grid>
  1. Implement the OnDragHandled method in codebehind with a simple Debug.WriteLine or something.
  2. Run and try to click and drag inside the graphics view.... it will scroll instead. You will not get more than 1 (usually 0) drag events.

Version with bug

6.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android emulator pixel 5 (standard)

Did you find any workaround?

Remove the ScrollViewer and it works... but this is hardly a workaround when you need a large list of images.

Relevant log output

No response

@limefrogyank limefrogyank added s/needs-verification Indicates that this issue needs initial verification before further triage will happen t/bug Something isn't working labels May 25, 2022
@VincentBu
Copy link

VincentBu commented May 26, 2022

not repro on Android emulator with vs main build(32525.350.main)

@VincentBu VincentBu added s/verified Verified / Reproducible Issue ready for Engineering Triage and removed s/needs-verification Indicates that this issue needs initial verification before further triage will happen labels May 26, 2022
@limefrogyank
Copy link
Author

Adding a test project that demonstrates the lack of multiple DragInteractions on Android.
ScrollTest.zip

@Eilon Eilon added the area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter label May 26, 2022
@jfversluis jfversluis added this to the Backlog milestone Mar 14, 2023
@ghost
Copy link

ghost commented Mar 14, 2023

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

@samhouts samhouts removed the s/verified Verified / Reproducible Issue ready for Engineering Triage label Apr 5, 2023
@homeyf homeyf added s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage labels Aug 8, 2023
@homeyf
Copy link
Collaborator

homeyf commented Aug 8, 2023

Verified this issue with Visual Studio Enterprise 17.7.0 Preview 6.0. Can repro on android platform with sample project.
ScrollTest.zip
image

@PhilJenson
Copy link

We have a similar issue when using a GraphicsView within a syncfusion listview, it prevents the swipe left/right feature working on Android. Trying alternative list controls also give the same result. On Android the swipe events do not appear to be propagated to the container and instead consumed within the GraphicsView

@Equabyte
Copy link

Equabyte commented May 13, 2024

Confirm presence of this issue in current MAUI version (8.0.21). On Android platform (at least) GraphicsView embedded in ScrollView responds correctly to StartInteraction and EndInteraction events but not to DragInteraction. Moreover, using DragInteraction causes the app to crash, unless run in debug mode. This is an important gap affecting user interaction with GraphicsView that would be worth fixing.

@malsabi
Copy link

malsabi commented May 18, 2024

I'm also facing this issue on the latest 8.0.5 RC5 release, Putting GraphicsView inside ScrollView stops the Drag event only if you're moving it on y-axis but when dragging on x-axis it works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter platform/android 🤖 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

9 participants