KEMBAR78
[iOS] Span's TapGestureRecognizer not working if text is truncated - UITest by kubaflo · Pull Request #22213 · dotnet/maui · GitHub
Skip to content

Conversation

@kubaflo
Copy link
Contributor

@kubaflo kubaflo commented May 5, 2024

Issues Fixed

Windows is not working either, but I have no machine to work on it
Fixes #21837

Before After
Screen.Recording.2024-05-05.at.20.33.23.mov
Screen.Recording.2024-05-05.at.20.31.50.mov

@kubaflo kubaflo requested a review from a team as a code owner May 5, 2024 22:48
@kubaflo kubaflo requested review from PureWeen and mattleibow May 5, 2024 22:48
@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label May 5, 2024
@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

jsuarezruiz
jsuarezruiz previously approved these changes Jun 10, 2024
Copy link
Member

@tj-devel709 tj-devel709 left a 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

@tj-devel709
Copy link
Member

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?

@kubaflo
Copy link
Contributor Author

kubaflo commented Mar 16, 2025

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?

@kubaflo kubaflo changed the title [iOS] Span's TapGestureRecognizer not working if text is truncated [iOS] Span's TapGestureRecognizer not working if text is truncated - uiTest Mar 16, 2025
@kubaflo kubaflo changed the title [iOS] Span's TapGestureRecognizer not working if text is truncated - uiTest [iOS] Span's TapGestureRecognizer not working if text is truncated - UITest Mar 16, 2025
@kubaflo kubaflo self-assigned this Mar 16, 2025
@mattleibow
Copy link
Member

/azp run MAUI-UITests-public

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@PureWeen PureWeen changed the base branch from main to inflight/current August 15, 2025 23:23
@PureWeen PureWeen merged commit 567aa26 into dotnet:inflight/current Aug 15, 2025
76 of 78 checks passed
github-actions bot pushed a commit that referenced this pull request Aug 15, 2025
github-actions bot pushed a commit that referenced this pull request Aug 19, 2025
github-actions bot pushed a commit that referenced this pull request Aug 22, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Sep 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-gestures Gesture types community ✨ Community Contribution platform/ios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Span's TapGestureRecognizer not working if text is truncated

5 participants