Skip to content

Conversation

@KarthikRajaKalaimani
Copy link
Contributor

@KarthikRajaKalaimani KarthikRajaKalaimani commented Apr 16, 2025

Issue Details:

The Tapped event or Command of the TapGestureRecognizer is not triggered for span text when tapped on iOS and Mac platforms.

Root Cause:

In the RecalculateSpanPositions method of the FormattedStringExtension class, span regions are created only when the native bounds are greater than 0. In our scenario, the native bounds of the Label were 0 when its visibility changed from false to true. So, we added an early return in the RecalculateSpanPositions method when the native bounds are 0, preventing the creation of invalid span regions.

Description of Change:

Since RecalculateSpanPositions is invoked from the ArrangeOverride method in LabelHandler.iOS, where the actual size of the label is available, I modified the logic to pass the correct bounds from the Arrange step. These bounds are then used in RecalculateSpanPositions to create span regions, instead of relying on potentially outdated native label bounds.

Tested the behavior in the following platforms.

  • Android
  • Windows
  • iOS
  • Mac

Reference:

N/A

Issues Fixed:

Fixes #28949

Screenshots

Before After
Screen.Recording.2025-04-16.at.4.46.52.PM.mov
Screen.Recording.2025-04-16.at.4.50.51.PM.mov

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Apr 16, 2025
@dotnet-policy-service
Copy link
Contributor

Hey there @@KarthikRajaKalaimani! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Apr 16, 2025
@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sheiksyedm
Copy link
Contributor

The UI test passed with the changes in this PR.

image

@KarthikRajaKalaimani KarthikRajaKalaimani marked this pull request as ready for review April 17, 2025 09:43
Copilot AI review requested due to automatic review settings April 17, 2025 09:43
@KarthikRajaKalaimani KarthikRajaKalaimani requested a review from a team as a code owner April 17, 2025 09:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

}

var finalSize = control.Bounds;
var finalSize = size;
Copy link

Copilot AI Apr 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider updating the XML documentation for RecalculateSpanPositions to document the new 'size' parameter and its role in reflecting the arranged bounds from LabelHandler. This will help maintain clarity for future developers maintaining this internal method.

Copilot uses AI. Check for mistakes.
@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

jsuarezruiz
jsuarezruiz previously approved these changes Apr 25, 2025
@PureWeen PureWeen changed the base branch from main to inflight/current April 28, 2025 15:20
@PureWeen PureWeen dismissed jsuarezruiz’s stale review April 28, 2025 15:20

The base branch was changed.

@PureWeen PureWeen merged commit d97d365 into dotnet:inflight/current Apr 28, 2025
77 checks passed
PureWeen pushed a commit that referenced this pull request May 5, 2025
…h doesn't get IsVisible (=true) update from its parent (#29024)

* Fixed On iOS GestureRecognizers don't work on Span in a Label, which doesn't get IsVisible (=true) update from its parent

* Test case added

* Test case name modified

* Test case modified
PureWeen pushed a commit that referenced this pull request May 5, 2025
…h doesn't get IsVisible (=true) update from its parent (#29024)

* Fixed On iOS GestureRecognizers don't work on Span in a Label, which doesn't get IsVisible (=true) update from its parent

* Test case added

* Test case name modified

* Test case modified
PureWeen added a commit that referenced this pull request May 8, 2025
For more information about inflight process check
https://github.com/dotnet/maui/wiki/Inflight-Branch-Process

## .NET MAUI Release Notes - inflight/candidate

This document contains release notes for changes from main branch to
inflight/candidate branch.

### MAUI Product Fixes
* [iOS] Fix: FlyoutPage memory leak by @bhavanesh001 in
#28769
* [Windows] Fix for CarouselView IsSwipeEnabled=False Prevents Visual
Navigation by @SubhikshaSF4852 in
#29286
* [Windows] Fix for Argument Exception raised when the GetStringSize
method of ICanvas called with default font by @SyedAbdulAzeemSF4852 in
#29048
* Removed frame styles by @Vignesh-SF3580 in
#29222
* [Android] Fixed the CollectionView Header and Footer Do Not Align with
Horizontal ItemsLayout When EmptyView is Displayed by @Ahamed-Ali in
#28779
* Add global xmlns in template by @StephaneDelcroix in
#29203
* Fixed - On iOS GestureRecognizers don't work on Span in a Label, which
doesn't get IsVisible (=true) update from its parent by
@KarthikRajaKalaimani in #29024
* Fixed Footer not displayed at the Bottom When EmptyView in CV2 by
@Dhivya-SF4094 in #28681
* Fixed typo in Connectivity.shared.cs by @corvinsz in
#29213

### Testing
* Re-enabled flaky UI test TextInEditorShouldScroll by
@NirmalKumarYuvaraj in #29167
* [Testing] Re-Enabled UI Test - Issue10222Test by @TamilarasanSF4853 in
#29226
* [Testing] Feature Matrix UITest Cases for CollectionView Selection
Feature by @LogishaSelvarajSF4525 in
#29165

### Dependency Updates
*No dependency updates in this release*

### Docs
*No documentation changes in this release*

### Housekeeping
*No housekeeping changes in this release*

## New Contributors
* @corvinsz made their first contribution in
#29213

**Full Changelog**:
main...inflight/candidate
SuthiYuvaraj pushed a commit to SuthiYuvaraj/maui that referenced this pull request May 9, 2025
…h doesn't get IsVisible (=true) update from its parent (dotnet#29024)

* Fixed On iOS GestureRecognizers don't work on Span in a Label, which doesn't get IsVisible (=true) update from its parent

* Test case added

* Test case name modified

* Test case modified
@github-actions github-actions bot locked and limited conversation to collaborators May 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-label Label, Span community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/ios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

On iOS GestureRecognizers don't work on Span in a Label, which doesn't get IsVisible (=true) update from its parent

4 participants