xamarin/Xamarin.Forms

[Bug] ContextAction Button on ListView Cell on iOS passes Tap to Cell when CanExecute is false

Aperta

#8763 aperta il 5 dic 2019

 (0 commenti) (0 reazioni) (0 assegnatari)C# (1926 fork)batch import
a/listviewe/2 :clock2:good first issuehacktoberfest 🍻help wantedin-progresst/bug :bug:up-for-grabs

Metriche repository

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

Descrizione

Description

When you add a ItemTapped event to a ListView and fill it's ViewCells ContextActions with a MenuItem whose Commands CanExecute is false, then tapping that ContextActions button on iOS will simply pass the tap to the underlying ViewCell. This seems like a bug to us, tapping a disabled button at that point should simply not do anything at all.

Steps to Reproduce

  1. Clone the repository.
  2. Start the project on iOS.
  3. Open the ContextActions on an Item and Tap on the Context Action.
  4. Notice that the Taps on Items counter has increased by one, indicating that the ItemTapped on the ListView has been fired.

Expected Behavior

The ItemTapped on the ListView should not be fired.

Actual Behavior

The ItemTapped on the ListView is fired.

Basic Information

  • Version with issue: Noticed in 4.2.0.709249 and later
  • Last known good version: -
  • IDE: Microsoft Visual Studio Professional 2019
  • Platform Target Frameworks:
    • iOS: 13.1

Reproduction Link

https://github.com/BasileusBasileon/Xamarin-ListView-ContextAction-iOS-Bug

Guida contributor