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

[Android] Programmatically creating FormattedString Spans with GestureRecognizers causes duplicate Command runs #21273

Open kklose23 opened 8 months ago

kklose23 commented 8 months ago

Description

I have a custom Span control that accepts a tap command. When programatically creating a FormattedString for a label that contains multiple gesture spans, the tap commands run multiple times

Steps to Reproduce

  1. Open linked repo
  2. Click button to generate the Label Spans
  3. Click one of the Spans
  4. The alert will show two times
  5. Regenerate the label again by clicking the button
  6. The alert will now show even more times
  7. This is only happening on Android

Link to public reproduction project repository

https://github.com/kklose23/gesture-spans

Version with bug

8.0.7 SR2

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

No response

Did you find any workaround?

No

Relevant log output

No response

eshalisa commented 7 months ago

Any update on when this will be fixed?

XamlTest commented 7 months ago

Verified on VS 17.10.0 Preview 2.0(8.0.20). Repro on Android 14.0-API34, not repro on iOS 17.2 with below Project: MonkeyFinder.zip

AndroidCommand

kubaflo commented 2 weeks ago

It works fine in NET9