Skip to content

Tapping to close a SwipeView will activate TapGestureRecognizers on .Content #23921

@sjordanGSS

Description

@sjordanGSS

Description

When a SwipeView is swiped, it can be tapped to close. However, this tap will also activate TapGestureRecognizers attached to the Content views

Please note that although I have not tested other .NET MAUI versions, this bug is present in Xamarin.Forms. I have recently revisited a project based upon Xamarin.Forms 5 that includes the workaround stated below.

Steps to Reproduce

  • Download and run the reproduction
  • Swipe the Label left or right
  • Tap to close
  • The text "content tapped" will be printed to the debug output, to indicate that the TapGestureRecognizer attached to the Label has been activated.

Link to public reproduction project repository

https://github.com/sjordanGSS/swipeview-content-gesture

Version with bug

8.0.70 SR7, 8.0.61 SR6

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Tested and reproduced on Android 7.1, 10, 11, 14

Did you find any workaround?

Code can be added to SwipeView.SwipeEnded and SwipeViewItem.Tapped to set the Content's IsEnabled to false while the view is swiped, however this will malfunction if the SwipeView is closed with a long press.

I tried wrapping the Label in a ContentView to see if this issue was exclusive to the immediate children of the SwipeView, however it had no effect.

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions