dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.26k stars 1.76k forks source link

[iOS] Command event spills to parent if child command is busy (when ICommand CanExecute is false) #25885

Open armanimichael opened 6 days ago

armanimichael commented 6 days ago

Description

On iOS only, with a setup, where both parent and child each have: command for a tap event for example

If the child command ICommand CanExecute == false, clicking on the child will "spill" the event to the parent element's command.

Image

Steps to Reproduce

  1. Checkout the reproduction project: https://github.com/armanimichael/maui-element-event-bug
  2. Tap the "Click me (top)" button
  3. Tap the same button again (the button will be disabled, because busy as it cannot handle concurrent events)
  4. The parent event will trigger

Link to public reproduction project repository

https://github.com/armanimichael/maui-element-event-bug

Version with bug

8.0.93 SR9.3

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

No response

Did you find any workaround?

Allowing concurrent executions on the child command (or making sure the user can still tap on the child, handling the disabled state manually) can be used to circumvent this behavior.

This is obviously suboptimal, both because on Android this works differently, and because the developer needs to account for concurrent executions / disabled element in a different manner.

Relevant log output

kevinxufei commented 3 days ago

I can repro this issue at iOS platform on the latest 17.13.0 Preview 1.0(8.0.93 & 8.0.100).

mattleibow commented 3 days ago

Note for future me: I wonder if it is because of the way iOS disables things. We may be setting the is user interactable to false, which auto-bubbles the event.