KEMBAR78
Span's TapGestureRecognizer not working if text is truncated · Issue #21837 · dotnet/maui · GitHub
Skip to content

Span's TapGestureRecognizer not working if text is truncated #21837

@Veilenus

Description

@Veilenus

Description

Consider a Label with FormattedText and a TapGestureRecognizer attached to one of its Spans. The TapGestureRecognizer does not execute the Command if the Label's text is truncated, either as a result of limiting MaxLines and the available width or by limiting both, width and height.

This bug affects the app on Windows, but not on Android. Other platforms are untested.

Tested versions:

  • 8.0.20 (bug present)
  • 8.0.10 (bug present)

Steps to Reproduce

  1. Check out the attached reprodution repo and start the app on Windows.
  2. Click the highlighted Labels.
  3. Observe that only Labels whose text is fully visible will execute the command (i.e. update the counter).

Link to public reproduction project repository

https://github.com/Veilenus/FormattedTextGestureRecognizerBug

Version with bug

8.0.20 SR4

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

Windows, I was not able test on other platforms

Affected platform versions

No response

Did you find any workaround?

Unfortunately, no. A hacky one might be considered if the Label's FontSize and LineHeight are statically known, thus allowing to wrap the Label in a Layout of choice and limiting the latter's HeightRequest instead of the Label's MaxLines.

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions