-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[iOS] Span's TapGestureRecognizer not working if text is truncated - UITest #22213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
src/Controls/src/Core/Platform/iOS/Extensions/FormattedStringExtensions.cs
Outdated
Show resolved
Hide resolved
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is in the right direction and definitely when there is truncation, this is not working correctly because it is looking for the rect around the last character but that character is not rendered and get an empty rect.
The issue I see with using the finalSize.Bottom is when we have a frame that is longer than the span we'd like, there is extra space being added to the 'hitbox' area of the span that we do not want.
Screen.Recording.2024-07-11.at.5.08.17.PM.mov
<Label AutomationId="label7" HorizontalOptions="Start" MaxLines="5" BackgroundColor="LightGoldenrodYellow" WidthRequest="200" HeightRequest="400">
<Label.FormattedText>
<FormattedString>
<Span Text="Only our MaxLines differ. Otherwise we're the same. Please tap us!">
<Span.GestureRecognizers>
<TapGestureRecognizer Command="{Binding TapCommand}" />
</Span.GestureRecognizers>
</Span>
</FormattedString>
</Label.FormattedText>
</Label>This is a great idea though and maybe it can be tweaked to find a good middle ground
|
Perhaps something like a check if the endRect is the empty rect and the startRect is not the empty rect, then maybe that is enough to assume there is truncation going on and we can use the finalSize? |
|
Hi @tj-devel709 I've rebased and the issue seems to be fixed. So maybe just merge the UI test I've added and close this bug? |
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Issues Fixed
Windows is not working either, but I have no machine to work on it
Fixes #21837
Screen.Recording.2024-05-05.at.20.33.23.mov
Screen.Recording.2024-05-05.at.20.31.50.mov