Skip to content

[iOS/Mac] Fix UI becoming unresponsive when adding many Entry/Editor children to AbsoluteLayout - #36671

Merged
kubaflo merged 1 commit into
dotnet:inflight/currentfrom
praveenkumarkarunanithi:fix-34393
Jul 29, 2026
Merged

kubaflo merged 1 commit into
dotnet:inflight/currentfrom
praveenkumarkarunanithi:fix-34393

Conversation

@praveenkumarkarunanithi

@praveenkumarkarunanithi praveenkumarkarunanithi commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue.
Thank you!

Root Cause

On iOS/MacCatalyst, UIView.Interactions is a native property — each read marshals the entire interactions array across the managed↔native interop boundary. A UITextView (the platform view behind Editor) carries ~22 interactions.

Two code paths in the gesture/handler setup re-read this property repeatedly per view instead of once:

  • The gesture manager's recognizer-loading loop re-read it on every iteration (~2× per interaction).
  • The tooltip lookup read it twice (a null-check followed by an enumeration).

Each Editor triggers this setup during layout. At ~200 editors, the redundant reads compounded into thousands of full-array interop marshals on the UI thread, freezing the app for ~20 seconds.

Description of Change

Cache the Interactions array into a local variable and read it once in both paths, then iterate the cached copy.
The change is purely an elimination of redundant interop calls — iteration order, removal logic, and tooltip resolution are unchanged, so behavior is identical.

Issues Fixed

Fixes #34396

Tested the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Screenshots

Before Issue Fix After Issue Fix
BeforeFix_iOS.mov
AfterFix_iOS.mov
BeforeFix_mac.mov
AfterFix_mac.mov

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 36671

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 36671"

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service dotnet-policy-service Bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Jul 20, 2026
@praveenkumarkarunanithi praveenkumarkarunanithi added platform/macos macOS / Mac Catalyst platform/ios area-controls-entry Entry partner/syncfusion Issues / PR's with Syncfusion collaboration and removed partner/syncfusion Issues / PR's with Syncfusion collaboration labels Jul 20, 2026
@vishnumenon2684 vishnumenon2684 added the community ✨ Community Contribution label Jul 20, 2026
@sheiksyedm
sheiksyedm marked this pull request as ready for review July 20, 2026 07:31
Copilot AI review requested due to automatic review settings July 20, 2026 07:31
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR targets an iOS/MacCatalyst performance regression where adding many Entry/Editor children (notably Editor/UITextView) can freeze the UI due to repeated managed↔native marshaling of UIView.Interactions during gesture/tooltip setup.

Changes:

  • Cache UIView.Interactions into a local variable in tooltip resolution to avoid repeated native array marshaling.
  • Cache PlatformView.Interactions into a local variable in the gesture platform manager cleanup loop to avoid repeated marshaling.
  • Add a HostApp repro page + Appium UI test to guard against the UI-freeze regression when adding 200 Editors.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/Core/src/Platform/iOS/ViewExtensions.cs Caches Interactions during tooltip lookup to avoid repeated interop marshaling.
src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.iOS.cs Caches Interactions during interaction cleanup to avoid repeated interop marshaling.
src/Controls/tests/TestCases.HostApp/Issues/Issue34396.cs Adds a repro page that adds 200 Editors to an AbsoluteLayout and reports elapsed time.
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34396.cs Adds an Appium test asserting the “add many Editors” scenario completes and the UI remains responsive.

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Jul 21, 2026
@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added s/agent-review-in-progress AI review is currently running for this PR and removed s/agent-review-in-progress AI review is currently running for this PR labels Jul 23, 2026
@MauiBot MauiBot added s/agent-approved AI agent recommends approval - PR fix is correct and optimal s/agent-gate-failed AI could not verify tests catch the bug s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) labels Jul 23, 2026
MauiBot

This comment was marked as outdated.

@MauiBot MauiBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Expert Review — 1 findings

See inline comments for details.

var status = App.FindElement("StatusLabel34396").GetText() ?? string.Empty;
var elapsedMs = long.Parse(status.Replace("Completed:", string.Empty, StringComparison.Ordinal).Trim(), CultureInfo.InvariantCulture);

Assert.That(elapsedMs, Is.LessThan(10000),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🔍 AI-Generated Review (multi-model)

❌ Regression test gap — The supplied gate result shows this assertion still passes without the fix, so the test does not reproduce #34396 or protect the cached-Interactions hot path from regressing. Please tighten the repro (for example, increase the workload or lower/structure the threshold so it fails on the base commit) before relying on this as the regression test.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Jul 23, 2026
@kubaflo

kubaflo commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@MauiBot MauiBot added s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates and removed s/agent-fix-win AI found a better alternative fix than the PR labels Jul 29, 2026
@MauiBot

MauiBot commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

AI Review Summary

@praveenkumarkarunanithi — new AI review results are available based on this last commit: 6203edb.

Gate Partial Confidence Low Platform iOS


🗂️ Review Sessions — click to expand
🚦 Gate — Test Before & After Fix

Gate Result: ❌ FAILED

Platform: IOS · Base: main · Merge base: 39c19e15

🩺 Test does not reproduce the bug — ran the same in both states (PASS without fix, PASS with fix). The repro test is not exercising the issue. Strengthen the test before reviewing the fix.

Test Without Fix (expect FAIL) With Fix (expect PASS)
🖥️ Issue34396 Issue34396 ❌ PASS — 740s ✅ PASS — 143s
🔴 Without fix — 🖥️ Issue34396: PASS ❌ · 740s

(no coded error found; showing last 1200 chars)

.1 (arm64)

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.06]   Discovering: Controls.TestCases.iOS.Tests
[xUnit.net 00:00:00.19]   Discovered:  Controls.TestCases.iOS.Tests
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.iOS.Tests/Debug/net10.0/Controls.TestCases.iOS.Tests.dll
   NUnit3TestExecutor discovered 1 of 1 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 7/29/2026 7:43:39 AM FixtureSetup for Issue34396(iOS)
>>>>> 7/29/2026 7:43:51 AM AddingManyEditorsDoesNotFreezeUI Start
>>>>> 7/29/2026 7:44:28 AM AddingManyEditorsDoesNotFreezeUI Stop
  Passed AddingManyEditorsDoesNotFreezeUI [36 s]
NUnit Adapter 4.5.0.0: Test execution complete
Results File: /Users/cloudtest/vss/_work/1/s/CustomAgentLogsTmp/UITests/TestResults/Issue34396.trx

Test Run Successful.
Total tests: 1
     Passed: 1
 Total time: 2.8241 Minutes
>>> TRX_RESULT_FILE: /Users/cloudtest/vss/_work/1/s/CustomAgentLogsTmp/UITests/TestResults/Issue34396.trx

🟢 With fix — 🖥️ Issue34396: PASS ✅ · 143s

(no coded error found; showing last 1200 chars)

1 (arm64)

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.06]   Discovering: Controls.TestCases.iOS.Tests
[xUnit.net 00:00:00.20]   Discovered:  Controls.TestCases.iOS.Tests
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.iOS.Tests/Debug/net10.0/Controls.TestCases.iOS.Tests.dll
   NUnit3TestExecutor discovered 1 of 1 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 7/29/2026 7:51:28 AM FixtureSetup for Issue34396(iOS)
>>>>> 7/29/2026 7:51:36 AM AddingManyEditorsDoesNotFreezeUI Start
>>>>> 7/29/2026 7:51:58 AM AddingManyEditorsDoesNotFreezeUI Stop
  Passed AddingManyEditorsDoesNotFreezeUI [22 s]
NUnit Adapter 4.5.0.0: Test execution complete
Results File: /Users/cloudtest/vss/_work/1/s/CustomAgentLogsTmp/UITests/TestResults/Issue34396.trx

Test Run Successful.
Total tests: 1
     Passed: 1
 Total time: 51.1164 Seconds
>>> TRX_RESULT_FILE: /Users/cloudtest/vss/_work/1/s/CustomAgentLogsTmp/UITests/TestResults/Issue34396.trx

⚠️ Failure Details

  • ❌ Issue34396 PASSED without fix (should fail) — tests don't catch the bug
📁 Fix files reverted (2 files)
  • src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.iOS.cs
  • src/Core/src/Platform/iOS/ViewExtensions.cs

📱 UI Tests — Editor,Gestures,InputTransparent,ViewBaseTests

Detected UI test categories: Editor,Gestures,InputTransparent,ViewBaseTests

❌ Deep UI tests — 278 passed, 1 failed across 4 categories on platform-pool agent (replaces in-process counts above).

🧪 UI Test Execution Results (deep, platform pool)

Category Tests Snapshot diffs
Editor 69/71 (1 ❌) —
Gestures 55/56 ✓ —
InputTransparent 42/42 ✓ —
ViewBaseTests 112/112 ✓ —
🔍 AI analysis of failures — PR-related vs unrelated

🔍 AI-generated triage (GitHub Copilot CLI) — a heuristic judgement of whether each deep UI test failure is connected to this PR's changes. Verify before relying on it.

Likely unrelated: the failures appear pre-existing, flaky, or infrastructure.

  • ● Unrelated — Existing Editor alignment UI test element lookup (~1 test): EditorRuntimeTextAlignmentChanged fails with a generic Appium NoSuchElementException, while the PR's iOS changes cache UIView.Interactions for gesture/input-transparency performance and add a separate Editor stress test, with no plausible connection to runtime text-alignment element availability.

Strongest signal: the failure is an element-discovery error in an existing alignment scenario, not the new large-Editor freeze scenario or the modified iOS interaction-removal path.

❌ Editor — 1 failed test
EditorRuntimeTextAlignmentChanged
OpenQA.Selenium.NoSuchElementException : An element could not be located on the page using the given search parameters.; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse, String commandToExecute)
   at OpenQA.Selenium.WebDriver.ExecuteAsync(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.Appium.AppiumDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.WebDriver.FindElement(String mechanism, String value)
   at OpenQA.Selenium.Appium.AppiumDriver.FindElement(String by, String value)
   at OpenQA.Selenium.Appium.MobileBy.FindElement(ISearchContext context)
   at OpenQA.Selenium.WebDriver.FindElement(By by)
   at OpenQA.Selenium.Appium.AppiumDriver.FindElement(By by)
   at Microsoft.Maui.TestCases.Tests.KeyboardScrolling.CloseiOSEditorKeyboard(AppiumDr
...

📎 Download drop-deep-uitests artifact (TRX + snapshot diffs)


📋 Pre-Flight — Context & Validation

Issue: #34396 - UI becomes unresponsive when adding more than 200 Entry children to AbsoluteLayout
PR: #36671 - [iOS/Mac] Fix UI becoming unresponsive when adding many Entry/Editor children to AbsoluteLayout
Platforms Affected: iOS, MacCatalyst
Files Changed: 2 implementation, 2 test

Key Findings

  • PR changes two iOS/MacCatalyst UIView.Interactions enumeration sites to cache the native interactions array before iterating, reducing repeated managed/native marshaling in gesture and tooltip setup paths.
  • The added UI test targets Editor on iOS and waits for a bulk-add page to report completion, but the completed gate result shows the test passes both without and with the fix.
  • Prior inline review already flagged the same regression-test gap; that ❌ finding remains unresolved.
  • Changed implementation files affect platform gesture/tooltip initialization paths used by controls such as Editor/Entry, so adjacent gesture and input scenarios are in blast radius.
  • gh is unauthenticated in this environment; PR and issue context was gathered through local git plus the public GitHub REST API.

Code Review Summary

Verdict: NEEDS_CHANGES
Confidence: low
Errors: 1 | Warnings: 0 | Suggestions: 0

Key code review findings:

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #36671 Cache UIView.Interactions in locals before iterating in gesture manager and tooltip lookup paths. ❌ Gate failed: test passes without fix and with fix src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.iOS.cs, src/Core/src/Platform/iOS/ViewExtensions.cs Original PR; production change appears localized, but regression test is not discriminating.

🔬 Code Review — Deep Analysis

Code Review — PR #36671

Independent Assessment

What this changes: Caches UIView.Interactions locally before iterating in two iOS/MacCatalyst hot paths, plus adds an Appium regression test/page for adding 200 Editors.
Inferred motivation: Avoid repeated native-array marshaling that freezes UI when many Editor/UITextView instances are added.

Reconciliation with PR Narrative

Author claims: Redundant UIView.Interactions reads cause thousands of interop marshals; caching preserves behavior and improves responsiveness.
Agreement/disagreement: Production-code assessment matches. The regression-test claim is not verified: prior gate evidence says the test passes without the fix.

Prior Review Reconciliation

Prior ❌ Error Finding Source Status Evidence
Regression test does not reproduce #34396; it passed without the fix MauiBot review + inline comment ❌ Unresolved Current head is the same reviewed commit 6203edb...; Issue34396.cs:28 still asserts only elapsed time < 10000, matching the prior failed gate evidence.

External Output Contract

Consumer token/pattern Producer location Producer emission condition Consumer assumption Ordinary negative case Downstream effect
N/A N/A No changed code classifies external tool output with regex/string literals. N/A N/A N/A

Blast Radius Assessment

  • Runs for all instances: Yes, for iOS/MacCatalyst views whose gesture/tooltip paths inspect UIView.Interactions.
  • Startup impact: Possible during handler/page initialization for controls with these platform paths.
  • Static/shared state: No new static/shared state.

CI Status

  • Required-check result: fail/undetermined requiredness; gh pr checks --required unavailable due unauthenticated gh.
  • Classification: Public check-runs show maui-pr-uitests and Build Analysis failing; failure is Android DatePicker app crash, apparently unrelated to changed iOS/Mac Editor code. Separately, prior gate failure remains PR-relevant.
  • Action taken: Invoked azdo-build-investigator; ci-analysis skill unavailable; capped confidence low.

Findings

❌ Error — Regression test does not prove the fix

src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34396.cs:28 uses a broad elapsed-time threshold (< 10000) that prior gate runs proved still passes without the production fix. Since the test file is unchanged after MauiBot's ❌ finding, this PR still lacks a regression test that fails on base and passes with the fix.

Failure-Mode Probing

  • Cached Interactions stale while removing: Load/tooltip updates are UI-thread platform work; no concurrent mutation path found, and snapshot iteration preserves intended removal/lookup behavior.
  • Null/default Interactions: Existing code already dereferenced arrays in these OS-gated paths; caching does not add a new null-sensitive path.
  • Handler reconnect/disconnect: No new subscriptions or persistent state; disposal/removal logic remains unchanged.
  • Test negative case: Base commit should fail the regression test; prior gate shows it passes, so coverage is insufficient.

Verdict: NEEDS_CHANGES

Confidence: low
Summary: The production optimization looks sound and appropriately localized, but an unresolved prior ❌ finding shows the added regression test does not catch the bug. CI required status could not be verified through authenticated gh, and public checks are red, so this cannot be LGTM.


🛠️ Fix — Analysis & Comparison

Fix Candidates

# Source Approach Test Result Files Changed Notes
1 try-fix Add a conservative empty-recognizer fast path in GesturePlatformManager.LoadRecognizers() and remove the PR's local Interactions caching. ⚠️ PASS but non-discriminating 2 files Issue34396 passed in 23s, but gate proved the same test passes without a fix. Broader/riskier than PR because it adds an early return in shared gesture setup.
2 try-fix Cache owned/found UIToolTipInteraction instances with weak per-view storage and skip native scanning on no-tooltip updates. ⚠️ PASS but non-discriminating 2 files Issue34396 passed in 25s, but gate proved the same test passes without a fix. Adds tooltip discovery semantics and weak cache risk.
3 expert-review Track MAUI-owned fake-right-click interactions instead of scanning native Interactions. ❌ NOT RUN 0 files Rejected before application: not on the no-gesture iOS Editor repro path and would only validate via the same inadequate test.
PR PR #36671 Cache UIView.Interactions once at two local enumeration sites: fake-right-click cleanup and tooltip lookup. ❌ Gate failed 2 implementation files + 2 test files Production change is the most localized runtime fix found, but the regression test is inadequate because it passes without the fix.

Cross-Pollination

Model Round New Ideas? Details
maui-expert-reviewer 1 Yes Empty recognizer fast path in GesturePlatformManager.LoadRecognizers().
maui-expert-reviewer 2 Yes Owned UIToolTipInteraction cache to avoid no-tooltip native interaction scans.
maui-expert-reviewer 3 No applicable production fix Proposed fake-right-click ownership registry, but it does not execute in the reported no-gesture iOS Editor repro. Recommended strengthening the regression test instead.

Exhausted: Yes
Selected Fix: PR #36671's production fix remains preferable among runtime candidates because it is the narrowest and least behavior-changing approach. However, no fix is ready to accept until the regression test is strengthened: the gate showed Issue34396 passes both without and with the fix, so none of the passing candidate test results are probative.

Test Evidence

  • Gate result already completed separately: ❌ FAILED because Issue34396 passed without the fix and with the fix.
  • try-fix-1 command: pwsh .github/scripts/BuildAndRunHostApp.ps1 -Platform ios -TestFilter "FullyQualifiedName~Issue34396"; result: test run successful, 1 passed, AddingManyEditorsDoesNotFreezeUI passed in 23s.
  • try-fix-2 command: pwsh .github/scripts/BuildAndRunHostApp.ps1 -Platform ios -TestFilter "FullyQualifiedName~Issue34396"; result: test run successful, 1 passed, AddingManyEditorsDoesNotFreezeUI passed in 25s.

Failure Analysis

The iterative loop did not find a demonstrably better runtime fix. Both materialized alternatives pass only the current inadequate test, and the third expert-generated idea is not applicable to the no-gesture repro. The critical blocker is test quality, not lack of runtime possibilities: before comparing PR #36671 against alternatives, Issue34396 needs to be made discriminating enough to fail on the broken baseline.


🏁 Report — Final Recommendation

Comparative Report — PR #36671

Candidates compared

Rank Candidate Regression-test evidence Assessment
1 pr-plus-reviewer ⚠️ Not re-run; addresses the failed-gate cause in the candidate design Best overall direction: preserves the PR's localized, behavior-preserving production fix and incorporates the expert reviewer's required test-strengthening feedback. Still not merge-ready until the strengthened test is proven to fail without the fix and pass with it.
2 pr ❌ Gate failed: current test passed without the fix and with the fix Best production-code candidate as submitted, but blocked by non-discriminating regression coverage.
3 try-fix-1 ⚠️ Passed only the same non-discriminating Issue34396 test Adds an empty-recognizer fast path and removes the PR's local interaction caching. Broader and riskier than the PR because it introduces an early return in shared gesture setup, and its pass result is not probative.
4 try-fix-2 ⚠️ Passed only the same non-discriminating Issue34396 test Adds weak tooltip interaction caching and changes no-tooltip native scanning behavior. Broader than the PR and has a concrete semantic risk for externally-added tooltip interactions.
5 try-fix-3 ❌ Not run / not materialized Rejected before application because tracking fake-right-click interactions does not address the no-gesture iOS Editor repro path.

Regression-test rule application

No candidate has passed a discriminating regression test. The try-fix-1 and try-fix-2 runs are recorded as passing, but only against the same test that the gate proved also passes without any production fix; those are not treated as true regression passes. The raw PR's gate failure is a real blocker and keeps it below pr-plus-reviewer, whose only advantage is that it incorporates the expert reviewer's required correction to the test design.

Production-code comparison

The submitted PR fix is the narrowest runtime change. It caches UIView.Interactions at two local enumeration sites:

  • GesturePlatformManager.iOS.cs: fake-right-click cleanup now snapshots PlatformView.Interactions once before reverse iteration.
  • ViewExtensions.cs: tooltip lookup now snapshots platformView.Interactions once before enumerating.

This preserves existing behavior while eliminating redundant native array marshaling. By contrast, try-fix-1 changes gesture-manager control flow and try-fix-2 changes tooltip discovery/cache semantics; neither demonstrated a real fix because both relied on the non-discriminating test.

Winner

Winner: pr-plus-reviewer

This is the best candidate because it keeps the safest production fix and incorporates the only actionable expert feedback: strengthen the regression test. It is a conditional winner, not a merge-ready result, because the required gate was not re-run and the current gate evidence remains failed.


🧭 Next Steps — review latest findings

No alternative fix was selected for this run. Review the session findings and CI results before merging.

@kubaflo
kubaflo changed the base branch from main to inflight/current July 29, 2026 19:32
@kubaflo
kubaflo merged commit 0217296 into dotnet:inflight/current Jul 29, 2026
166 of 170 checks passed
@github-actions github-actions Bot added this to the .NET 10 SR10 milestone Jul 29, 2026
kubaflo pushed a commit that referenced this pull request Aug 7, 2026
…children to AbsoluteLayout (#36671)

<!-- Please let the below note in for people that find this PR -->
   > [!NOTE]
   > Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
  Thank you!
 
### Root Cause
On iOS/MacCatalyst, `UIView.Interactions` is a native property — each
read marshals the entire interactions array across the managed↔native
interop boundary. A `UITextView` (the platform view behind `Editor`)
carries ~22 interactions.

Two code paths in the gesture/handler setup re-read this property
repeatedly per view instead of once:

* The gesture manager's recognizer-loading loop re-read it on every
iteration (~2× per interaction).
* The tooltip lookup read it twice (a null-check followed by an
enumeration).

Each `Editor` triggers this setup during layout. At ~200 editors, the
redundant reads compounded into thousands of full-array interop marshals
on the UI thread, freezing the app for ~20 seconds.

### Description of Change
Cache the `Interactions` array into a local variable and read it once in
both paths, then iterate the cached copy.
The change is purely an elimination of redundant interop calls —
iteration order, removal logic, and tooltip resolution are unchanged, so
behavior is identical.
 
### Issues Fixed
Fixes #34396 
 
Tested the behaviour in the following platforms
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac

### Screenshots
| Before Issue Fix | After Issue Fix |
|------------------|-----------------|
| <video width="350" alt="withoutfix"
src="https://github.com/user-attachments/assets/46035bcb-8c52-4dc2-bb7f-5bb9f879a5cc"
/><br><sub>iOS</sub> | <video width="350" alt="withfix"
src="https://github.com/user-attachments/assets/48de15ae-8d2e-45d9-ad8a-93299285355a"
/><br><sub>iOS</sub> |
| <video width="350" alt="withoutfix"
src="https://github.com/user-attachments/assets/f2f11304-9bfc-4db4-9524-b1955fcb3482"
/><br><sub>MacCatalyst</sub> | <video width="350" alt="withfix"
src="https://github.com/user-attachments/assets/9de4605b-ee01-4b38-b444-0ad86b720ac6"
/><br><sub>MacCatalyst</sub> |
kubaflo pushed a commit that referenced this pull request Aug 12, 2026
…children to AbsoluteLayout (#36671)

<!-- Please let the below note in for people that find this PR -->
   > [!NOTE]
   > Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
  Thank you!
 
### Root Cause
On iOS/MacCatalyst, `UIView.Interactions` is a native property — each
read marshals the entire interactions array across the managed↔native
interop boundary. A `UITextView` (the platform view behind `Editor`)
carries ~22 interactions.

Two code paths in the gesture/handler setup re-read this property
repeatedly per view instead of once:

* The gesture manager's recognizer-loading loop re-read it on every
iteration (~2× per interaction).
* The tooltip lookup read it twice (a null-check followed by an
enumeration).

Each `Editor` triggers this setup during layout. At ~200 editors, the
redundant reads compounded into thousands of full-array interop marshals
on the UI thread, freezing the app for ~20 seconds.

### Description of Change
Cache the `Interactions` array into a local variable and read it once in
both paths, then iterate the cached copy.
The change is purely an elimination of redundant interop calls —
iteration order, removal logic, and tooltip resolution are unchanged, so
behavior is identical.
 
### Issues Fixed
Fixes #34396 
 
Tested the behaviour in the following platforms
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac

### Screenshots
| Before Issue Fix | After Issue Fix |
|------------------|-----------------|
| <video width="350" alt="withoutfix"
src="https://github.com/user-attachments/assets/46035bcb-8c52-4dc2-bb7f-5bb9f879a5cc"
/><br><sub>iOS</sub> | <video width="350" alt="withfix"
src="https://github.com/user-attachments/assets/48de15ae-8d2e-45d9-ad8a-93299285355a"
/><br><sub>iOS</sub> |
| <video width="350" alt="withoutfix"
src="https://github.com/user-attachments/assets/f2f11304-9bfc-4db4-9524-b1955fcb3482"
/><br><sub>MacCatalyst</sub> | <video width="350" alt="withfix"
src="https://github.com/user-attachments/assets/9de4605b-ee01-4b38-b444-0ad86b720ac6"
/><br><sub>MacCatalyst</sub> |
@sheiksyedm sheiksyedm modified the milestones: .NET 10 SR10, .NET 10 SR11 Aug 26, 2026
kubaflo pushed a commit that referenced this pull request Aug 27, 2026
…children to AbsoluteLayout (#36671)

<!-- Please let the below note in for people that find this PR -->
   > [!NOTE]
   > Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
  Thank you!
 
### Root Cause
On iOS/MacCatalyst, `UIView.Interactions` is a native property — each
read marshals the entire interactions array across the managed↔native
interop boundary. A `UITextView` (the platform view behind `Editor`)
carries ~22 interactions.

Two code paths in the gesture/handler setup re-read this property
repeatedly per view instead of once:

* The gesture manager's recognizer-loading loop re-read it on every
iteration (~2× per interaction).
* The tooltip lookup read it twice (a null-check followed by an
enumeration).

Each `Editor` triggers this setup during layout. At ~200 editors, the
redundant reads compounded into thousands of full-array interop marshals
on the UI thread, freezing the app for ~20 seconds.

### Description of Change
Cache the `Interactions` array into a local variable and read it once in
both paths, then iterate the cached copy.
The change is purely an elimination of redundant interop calls —
iteration order, removal logic, and tooltip resolution are unchanged, so
behavior is identical.
 
### Issues Fixed
Fixes #34396 
 
Tested the behaviour in the following platforms
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac

### Screenshots
| Before Issue Fix | After Issue Fix |
|------------------|-----------------|
| <video width="350" alt="withoutfix"
src="https://github.com/user-attachments/assets/46035bcb-8c52-4dc2-bb7f-5bb9f879a5cc"
/><br><sub>iOS</sub> | <video width="350" alt="withfix"
src="https://github.com/user-attachments/assets/48de15ae-8d2e-45d9-ad8a-93299285355a"
/><br><sub>iOS</sub> |
| <video width="350" alt="withoutfix"
src="https://github.com/user-attachments/assets/f2f11304-9bfc-4db4-9524-b1955fcb3482"
/><br><sub>MacCatalyst</sub> | <video width="350" alt="withfix"
src="https://github.com/user-attachments/assets/9de4605b-ee01-4b38-b444-0ad86b720ac6"
/><br><sub>MacCatalyst</sub> |
kubaflo pushed a commit that referenced this pull request Sep 2, 2026
…children to AbsoluteLayout (#36671)

<!-- Please let the below note in for people that find this PR -->
   > [!NOTE]
   > Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
  Thank you!
 
### Root Cause
On iOS/MacCatalyst, `UIView.Interactions` is a native property — each
read marshals the entire interactions array across the managed↔native
interop boundary. A `UITextView` (the platform view behind `Editor`)
carries ~22 interactions.

Two code paths in the gesture/handler setup re-read this property
repeatedly per view instead of once:

* The gesture manager's recognizer-loading loop re-read it on every
iteration (~2× per interaction).
* The tooltip lookup read it twice (a null-check followed by an
enumeration).

Each `Editor` triggers this setup during layout. At ~200 editors, the
redundant reads compounded into thousands of full-array interop marshals
on the UI thread, freezing the app for ~20 seconds.

### Description of Change
Cache the `Interactions` array into a local variable and read it once in
both paths, then iterate the cached copy.
The change is purely an elimination of redundant interop calls —
iteration order, removal logic, and tooltip resolution are unchanged, so
behavior is identical.
 
### Issues Fixed
Fixes #34396 
 
Tested the behaviour in the following platforms
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac

### Screenshots
| Before Issue Fix | After Issue Fix |
|------------------|-----------------|
| <video width="350" alt="withoutfix"
src="https://github.com/user-attachments/assets/46035bcb-8c52-4dc2-bb7f-5bb9f879a5cc"
/><br><sub>iOS</sub> | <video width="350" alt="withfix"
src="https://github.com/user-attachments/assets/48de15ae-8d2e-45d9-ad8a-93299285355a"
/><br><sub>iOS</sub> |
| <video width="350" alt="withoutfix"
src="https://github.com/user-attachments/assets/f2f11304-9bfc-4db4-9524-b1955fcb3482"
/><br><sub>MacCatalyst</sub> | <video width="350" alt="withfix"
src="https://github.com/user-attachments/assets/9de4605b-ee01-4b38-b444-0ad86b720ac6"
/><br><sub>MacCatalyst</sub> |
kubaflo pushed a commit that referenced this pull request Sep 3, 2026
…children to AbsoluteLayout (#36671)

<!-- Please let the below note in for people that find this PR -->
   > [!NOTE]
   > Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
  Thank you!
 
### Root Cause
On iOS/MacCatalyst, `UIView.Interactions` is a native property — each
read marshals the entire interactions array across the managed↔native
interop boundary. A `UITextView` (the platform view behind `Editor`)
carries ~22 interactions.

Two code paths in the gesture/handler setup re-read this property
repeatedly per view instead of once:

* The gesture manager's recognizer-loading loop re-read it on every
iteration (~2× per interaction).
* The tooltip lookup read it twice (a null-check followed by an
enumeration).

Each `Editor` triggers this setup during layout. At ~200 editors, the
redundant reads compounded into thousands of full-array interop marshals
on the UI thread, freezing the app for ~20 seconds.

### Description of Change
Cache the `Interactions` array into a local variable and read it once in
both paths, then iterate the cached copy.
The change is purely an elimination of redundant interop calls —
iteration order, removal logic, and tooltip resolution are unchanged, so
behavior is identical.
 
### Issues Fixed
Fixes #34396 
 
Tested the behaviour in the following platforms
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac

### Screenshots
| Before Issue Fix | After Issue Fix |
|------------------|-----------------|
| <video width="350" alt="withoutfix"
src="https://github.com/user-attachments/assets/46035bcb-8c52-4dc2-bb7f-5bb9f879a5cc"
/><br><sub>iOS</sub> | <video width="350" alt="withfix"
src="https://github.com/user-attachments/assets/48de15ae-8d2e-45d9-ad8a-93299285355a"
/><br><sub>iOS</sub> |
| <video width="350" alt="withoutfix"
src="https://github.com/user-attachments/assets/f2f11304-9bfc-4db4-9524-b1955fcb3482"
/><br><sub>MacCatalyst</sub> | <video width="350" alt="withfix"
src="https://github.com/user-attachments/assets/9de4605b-ee01-4b38-b444-0ad86b720ac6"
/><br><sub>MacCatalyst</sub> |
kubaflo pushed a commit that referenced this pull request Sep 3, 2026
…children to AbsoluteLayout (#36671)

<!-- Please let the below note in for people that find this PR -->
   > [!NOTE]
   > Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
  Thank you!
 
### Root Cause
On iOS/MacCatalyst, `UIView.Interactions` is a native property — each
read marshals the entire interactions array across the managed↔native
interop boundary. A `UITextView` (the platform view behind `Editor`)
carries ~22 interactions.

Two code paths in the gesture/handler setup re-read this property
repeatedly per view instead of once:

* The gesture manager's recognizer-loading loop re-read it on every
iteration (~2× per interaction).
* The tooltip lookup read it twice (a null-check followed by an
enumeration).

Each `Editor` triggers this setup during layout. At ~200 editors, the
redundant reads compounded into thousands of full-array interop marshals
on the UI thread, freezing the app for ~20 seconds.

### Description of Change
Cache the `Interactions` array into a local variable and read it once in
both paths, then iterate the cached copy.
The change is purely an elimination of redundant interop calls —
iteration order, removal logic, and tooltip resolution are unchanged, so
behavior is identical.
 
### Issues Fixed
Fixes #34396 
 
Tested the behaviour in the following platforms
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac

### Screenshots
| Before Issue Fix | After Issue Fix |
|------------------|-----------------|
| <video width="350" alt="withoutfix"
src="https://github.com/user-attachments/assets/46035bcb-8c52-4dc2-bb7f-5bb9f879a5cc"
/><br><sub>iOS</sub> | <video width="350" alt="withfix"
src="https://github.com/user-attachments/assets/48de15ae-8d2e-45d9-ad8a-93299285355a"
/><br><sub>iOS</sub> |
| <video width="350" alt="withoutfix"
src="https://github.com/user-attachments/assets/f2f11304-9bfc-4db4-9524-b1955fcb3482"
/><br><sub>MacCatalyst</sub> | <video width="350" alt="withfix"
src="https://github.com/user-attachments/assets/9de4605b-ee01-4b38-b444-0ad86b720ac6"
/><br><sub>MacCatalyst</sub> |
kubaflo pushed a commit that referenced this pull request Sep 4, 2026
…children to AbsoluteLayout (#36671)

<!-- Please let the below note in for people that find this PR -->
   > [!NOTE]
   > Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
  Thank you!
 
### Root Cause
On iOS/MacCatalyst, `UIView.Interactions` is a native property — each
read marshals the entire interactions array across the managed↔native
interop boundary. A `UITextView` (the platform view behind `Editor`)
carries ~22 interactions.

Two code paths in the gesture/handler setup re-read this property
repeatedly per view instead of once:

* The gesture manager's recognizer-loading loop re-read it on every
iteration (~2× per interaction).
* The tooltip lookup read it twice (a null-check followed by an
enumeration).

Each `Editor` triggers this setup during layout. At ~200 editors, the
redundant reads compounded into thousands of full-array interop marshals
on the UI thread, freezing the app for ~20 seconds.

### Description of Change
Cache the `Interactions` array into a local variable and read it once in
both paths, then iterate the cached copy.
The change is purely an elimination of redundant interop calls —
iteration order, removal logic, and tooltip resolution are unchanged, so
behavior is identical.
 
### Issues Fixed
Fixes #34396 
 
Tested the behaviour in the following platforms
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac

### Screenshots
| Before Issue Fix | After Issue Fix |
|------------------|-----------------|
| <video width="350" alt="withoutfix"
src="https://github.com/user-attachments/assets/46035bcb-8c52-4dc2-bb7f-5bb9f879a5cc"
/><br><sub>iOS</sub> | <video width="350" alt="withfix"
src="https://github.com/user-attachments/assets/48de15ae-8d2e-45d9-ad8a-93299285355a"
/><br><sub>iOS</sub> |
| <video width="350" alt="withoutfix"
src="https://github.com/user-attachments/assets/f2f11304-9bfc-4db4-9524-b1955fcb3482"
/><br><sub>MacCatalyst</sub> | <video width="350" alt="withfix"
src="https://github.com/user-attachments/assets/9de4605b-ee01-4b38-b444-0ad86b720ac6"
/><br><sub>MacCatalyst</sub> |
kubaflo pushed a commit that referenced this pull request Sep 6, 2026
…children to AbsoluteLayout (#36671)

<!-- Please let the below note in for people that find this PR -->
   > [!NOTE]
   > Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
  Thank you!
 
### Root Cause
On iOS/MacCatalyst, `UIView.Interactions` is a native property — each
read marshals the entire interactions array across the managed↔native
interop boundary. A `UITextView` (the platform view behind `Editor`)
carries ~22 interactions.

Two code paths in the gesture/handler setup re-read this property
repeatedly per view instead of once:

* The gesture manager's recognizer-loading loop re-read it on every
iteration (~2× per interaction).
* The tooltip lookup read it twice (a null-check followed by an
enumeration).

Each `Editor` triggers this setup during layout. At ~200 editors, the
redundant reads compounded into thousands of full-array interop marshals
on the UI thread, freezing the app for ~20 seconds.

### Description of Change
Cache the `Interactions` array into a local variable and read it once in
both paths, then iterate the cached copy.
The change is purely an elimination of redundant interop calls —
iteration order, removal logic, and tooltip resolution are unchanged, so
behavior is identical.
 
### Issues Fixed
Fixes #34396 
 
Tested the behaviour in the following platforms
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac

### Screenshots
| Before Issue Fix | After Issue Fix |
|------------------|-----------------|
| <video width="350" alt="withoutfix"
src="https://github.com/user-attachments/assets/46035bcb-8c52-4dc2-bb7f-5bb9f879a5cc"
/><br><sub>iOS</sub> | <video width="350" alt="withfix"
src="https://github.com/user-attachments/assets/48de15ae-8d2e-45d9-ad8a-93299285355a"
/><br><sub>iOS</sub> |
| <video width="350" alt="withoutfix"
src="https://github.com/user-attachments/assets/f2f11304-9bfc-4db4-9524-b1955fcb3482"
/><br><sub>MacCatalyst</sub> | <video width="350" alt="withfix"
src="https://github.com/user-attachments/assets/9de4605b-ee01-4b38-b444-0ad86b720ac6"
/><br><sub>MacCatalyst</sub> |
kubaflo pushed a commit that referenced this pull request Sep 7, 2026
…children to AbsoluteLayout (#36671)

<!-- Please let the below note in for people that find this PR -->
   > [!NOTE]
   > Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
  Thank you!
 
### Root Cause
On iOS/MacCatalyst, `UIView.Interactions` is a native property — each
read marshals the entire interactions array across the managed↔native
interop boundary. A `UITextView` (the platform view behind `Editor`)
carries ~22 interactions.

Two code paths in the gesture/handler setup re-read this property
repeatedly per view instead of once:

* The gesture manager's recognizer-loading loop re-read it on every
iteration (~2× per interaction).
* The tooltip lookup read it twice (a null-check followed by an
enumeration).

Each `Editor` triggers this setup during layout. At ~200 editors, the
redundant reads compounded into thousands of full-array interop marshals
on the UI thread, freezing the app for ~20 seconds.

### Description of Change
Cache the `Interactions` array into a local variable and read it once in
both paths, then iterate the cached copy.
The change is purely an elimination of redundant interop calls —
iteration order, removal logic, and tooltip resolution are unchanged, so
behavior is identical.
 
### Issues Fixed
Fixes #34396 
 
Tested the behaviour in the following platforms
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac

### Screenshots
| Before Issue Fix | After Issue Fix |
|------------------|-----------------|
| <video width="350" alt="withoutfix"
src="https://github.com/user-attachments/assets/46035bcb-8c52-4dc2-bb7f-5bb9f879a5cc"
/><br><sub>iOS</sub> | <video width="350" alt="withfix"
src="https://github.com/user-attachments/assets/48de15ae-8d2e-45d9-ad8a-93299285355a"
/><br><sub>iOS</sub> |
| <video width="350" alt="withoutfix"
src="https://github.com/user-attachments/assets/f2f11304-9bfc-4db4-9524-b1955fcb3482"
/><br><sub>MacCatalyst</sub> | <video width="350" alt="withfix"
src="https://github.com/user-attachments/assets/9de4605b-ee01-4b38-b444-0ad86b720ac6"
/><br><sub>MacCatalyst</sub> |
kubaflo pushed a commit that referenced this pull request Sep 7, 2026
…children to AbsoluteLayout (#36671)

<!-- Please let the below note in for people that find this PR -->
   > [!NOTE]
   > Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
  Thank you!
 
### Root Cause
On iOS/MacCatalyst, `UIView.Interactions` is a native property — each
read marshals the entire interactions array across the managed↔native
interop boundary. A `UITextView` (the platform view behind `Editor`)
carries ~22 interactions.

Two code paths in the gesture/handler setup re-read this property
repeatedly per view instead of once:

* The gesture manager's recognizer-loading loop re-read it on every
iteration (~2× per interaction).
* The tooltip lookup read it twice (a null-check followed by an
enumeration).

Each `Editor` triggers this setup during layout. At ~200 editors, the
redundant reads compounded into thousands of full-array interop marshals
on the UI thread, freezing the app for ~20 seconds.

### Description of Change
Cache the `Interactions` array into a local variable and read it once in
both paths, then iterate the cached copy.
The change is purely an elimination of redundant interop calls —
iteration order, removal logic, and tooltip resolution are unchanged, so
behavior is identical.
 
### Issues Fixed
Fixes #34396 
 
Tested the behaviour in the following platforms
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac

### Screenshots
| Before Issue Fix | After Issue Fix |
|------------------|-----------------|
| <video width="350" alt="withoutfix"
src="https://github.com/user-attachments/assets/46035bcb-8c52-4dc2-bb7f-5bb9f879a5cc"
/><br><sub>iOS</sub> | <video width="350" alt="withfix"
src="https://github.com/user-attachments/assets/48de15ae-8d2e-45d9-ad8a-93299285355a"
/><br><sub>iOS</sub> |
| <video width="350" alt="withoutfix"
src="https://github.com/user-attachments/assets/f2f11304-9bfc-4db4-9524-b1955fcb3482"
/><br><sub>MacCatalyst</sub> | <video width="350" alt="withfix"
src="https://github.com/user-attachments/assets/9de4605b-ee01-4b38-b444-0ad86b720ac6"
/><br><sub>MacCatalyst</sub> |
kubaflo pushed a commit that referenced this pull request Sep 8, 2026
…children to AbsoluteLayout (#36671)

<!-- Please let the below note in for people that find this PR -->
   > [!NOTE]
   > Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
  Thank you!
 
### Root Cause
On iOS/MacCatalyst, `UIView.Interactions` is a native property — each
read marshals the entire interactions array across the managed↔native
interop boundary. A `UITextView` (the platform view behind `Editor`)
carries ~22 interactions.

Two code paths in the gesture/handler setup re-read this property
repeatedly per view instead of once:

* The gesture manager's recognizer-loading loop re-read it on every
iteration (~2× per interaction).
* The tooltip lookup read it twice (a null-check followed by an
enumeration).

Each `Editor` triggers this setup during layout. At ~200 editors, the
redundant reads compounded into thousands of full-array interop marshals
on the UI thread, freezing the app for ~20 seconds.

### Description of Change
Cache the `Interactions` array into a local variable and read it once in
both paths, then iterate the cached copy.
The change is purely an elimination of redundant interop calls —
iteration order, removal logic, and tooltip resolution are unchanged, so
behavior is identical.
 
### Issues Fixed
Fixes #34396 
 
Tested the behaviour in the following platforms
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac

### Screenshots
| Before Issue Fix | After Issue Fix |
|------------------|-----------------|
| <video width="350" alt="withoutfix"
src="https://github.com/user-attachments/assets/46035bcb-8c52-4dc2-bb7f-5bb9f879a5cc"
/><br><sub>iOS</sub> | <video width="350" alt="withfix"
src="https://github.com/user-attachments/assets/48de15ae-8d2e-45d9-ad8a-93299285355a"
/><br><sub>iOS</sub> |
| <video width="350" alt="withoutfix"
src="https://github.com/user-attachments/assets/f2f11304-9bfc-4db4-9524-b1955fcb3482"
/><br><sub>MacCatalyst</sub> | <video width="350" alt="withfix"
src="https://github.com/user-attachments/assets/9de4605b-ee01-4b38-b444-0ad86b720ac6"
/><br><sub>MacCatalyst</sub> |
kubaflo pushed a commit that referenced this pull request Sep 8, 2026
…children to AbsoluteLayout (#36671)

<!-- Please let the below note in for people that find this PR -->
   > [!NOTE]
   > Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
  Thank you!
 
### Root Cause
On iOS/MacCatalyst, `UIView.Interactions` is a native property — each
read marshals the entire interactions array across the managed↔native
interop boundary. A `UITextView` (the platform view behind `Editor`)
carries ~22 interactions.

Two code paths in the gesture/handler setup re-read this property
repeatedly per view instead of once:

* The gesture manager's recognizer-loading loop re-read it on every
iteration (~2× per interaction).
* The tooltip lookup read it twice (a null-check followed by an
enumeration).

Each `Editor` triggers this setup during layout. At ~200 editors, the
redundant reads compounded into thousands of full-array interop marshals
on the UI thread, freezing the app for ~20 seconds.

### Description of Change
Cache the `Interactions` array into a local variable and read it once in
both paths, then iterate the cached copy.
The change is purely an elimination of redundant interop calls —
iteration order, removal logic, and tooltip resolution are unchanged, so
behavior is identical.
 
### Issues Fixed
Fixes #34396 
 
Tested the behaviour in the following platforms
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac

### Screenshots
| Before Issue Fix | After Issue Fix |
|------------------|-----------------|
| <video width="350" alt="withoutfix"
src="https://github.com/user-attachments/assets/46035bcb-8c52-4dc2-bb7f-5bb9f879a5cc"
/><br><sub>iOS</sub> | <video width="350" alt="withfix"
src="https://github.com/user-attachments/assets/48de15ae-8d2e-45d9-ad8a-93299285355a"
/><br><sub>iOS</sub> |
| <video width="350" alt="withoutfix"
src="https://github.com/user-attachments/assets/f2f11304-9bfc-4db4-9524-b1955fcb3482"
/><br><sub>MacCatalyst</sub> | <video width="350" alt="withfix"
src="https://github.com/user-attachments/assets/9de4605b-ee01-4b38-b444-0ad86b720ac6"
/><br><sub>MacCatalyst</sub> |
kubaflo pushed a commit that referenced this pull request Sep 9, 2026
…children to AbsoluteLayout (#36671)

<!-- Please let the below note in for people that find this PR -->
   > [!NOTE]
   > Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
  Thank you!
 
### Root Cause
On iOS/MacCatalyst, `UIView.Interactions` is a native property — each
read marshals the entire interactions array across the managed↔native
interop boundary. A `UITextView` (the platform view behind `Editor`)
carries ~22 interactions.

Two code paths in the gesture/handler setup re-read this property
repeatedly per view instead of once:

* The gesture manager's recognizer-loading loop re-read it on every
iteration (~2× per interaction).
* The tooltip lookup read it twice (a null-check followed by an
enumeration).

Each `Editor` triggers this setup during layout. At ~200 editors, the
redundant reads compounded into thousands of full-array interop marshals
on the UI thread, freezing the app for ~20 seconds.

### Description of Change
Cache the `Interactions` array into a local variable and read it once in
both paths, then iterate the cached copy.
The change is purely an elimination of redundant interop calls —
iteration order, removal logic, and tooltip resolution are unchanged, so
behavior is identical.
 
### Issues Fixed
Fixes #34396 
 
Tested the behaviour in the following platforms
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac

### Screenshots
| Before Issue Fix | After Issue Fix |
|------------------|-----------------|
| <video width="350" alt="withoutfix"
src="https://github.com/user-attachments/assets/46035bcb-8c52-4dc2-bb7f-5bb9f879a5cc"
/><br><sub>iOS</sub> | <video width="350" alt="withfix"
src="https://github.com/user-attachments/assets/48de15ae-8d2e-45d9-ad8a-93299285355a"
/><br><sub>iOS</sub> |
| <video width="350" alt="withoutfix"
src="https://github.com/user-attachments/assets/f2f11304-9bfc-4db4-9524-b1955fcb3482"
/><br><sub>MacCatalyst</sub> | <video width="350" alt="withfix"
src="https://github.com/user-attachments/assets/9de4605b-ee01-4b38-b444-0ad86b720ac6"
/><br><sub>MacCatalyst</sub> |
kubaflo pushed a commit that referenced this pull request Sep 9, 2026
…children to AbsoluteLayout (#36671)

<!-- Please let the below note in for people that find this PR -->
   > [!NOTE]
   > Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
  Thank you!
 
### Root Cause
On iOS/MacCatalyst, `UIView.Interactions` is a native property — each
read marshals the entire interactions array across the managed↔native
interop boundary. A `UITextView` (the platform view behind `Editor`)
carries ~22 interactions.

Two code paths in the gesture/handler setup re-read this property
repeatedly per view instead of once:

* The gesture manager's recognizer-loading loop re-read it on every
iteration (~2× per interaction).
* The tooltip lookup read it twice (a null-check followed by an
enumeration).

Each `Editor` triggers this setup during layout. At ~200 editors, the
redundant reads compounded into thousands of full-array interop marshals
on the UI thread, freezing the app for ~20 seconds.

### Description of Change
Cache the `Interactions` array into a local variable and read it once in
both paths, then iterate the cached copy.
The change is purely an elimination of redundant interop calls —
iteration order, removal logic, and tooltip resolution are unchanged, so
behavior is identical.
 
### Issues Fixed
Fixes #34396 
 
Tested the behaviour in the following platforms
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac

### Screenshots
| Before Issue Fix | After Issue Fix |
|------------------|-----------------|
| <video width="350" alt="withoutfix"
src="https://github.com/user-attachments/assets/46035bcb-8c52-4dc2-bb7f-5bb9f879a5cc"
/><br><sub>iOS</sub> | <video width="350" alt="withfix"
src="https://github.com/user-attachments/assets/48de15ae-8d2e-45d9-ad8a-93299285355a"
/><br><sub>iOS</sub> |
| <video width="350" alt="withoutfix"
src="https://github.com/user-attachments/assets/f2f11304-9bfc-4db4-9524-b1955fcb3482"
/><br><sub>MacCatalyst</sub> | <video width="350" alt="withfix"
src="https://github.com/user-attachments/assets/9de4605b-ee01-4b38-b444-0ad86b720ac6"
/><br><sub>MacCatalyst</sub> |
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 25, 2026

This branch had an error being deployed

1 failed deployment
copilot-pat-pool — 6203edb6 Deployed Jul 20, 2026 by praveenkumarkarunanithi via pre_activation #858
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-entry Entry community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/ios platform/macos macOS / Mac Catalyst s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates s/agent-gate-failed AI could not verify tests catch the bug s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI becomes unresponsive when adding more than 200 Entry children to AbsoluteLayout

6 participants