Skip to content

[main] [iOS/MacCatalyst] Fix Editor and CarouselView remaining non-interactive after IsEnabled toggle - #38487

Merged
kubaflo merged 1 commit into
mainfrom
backport/pr-37849-to-main
Sep 12, 2026
Merged

kubaflo merged 1 commit into
mainfrom
backport/pr-37849-to-main

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Backport of #37849 to main

/cc @kubaflo @SyedAbdulAzeemSF4852

…ve after IsEnabled toggle (#37849)

<!-- 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!

### Issue Details
- On iOS, a CarouselView or Editor that initially has
IsEnabled="False"remains non-interactive after being re-enabled. Even
though IsEnabledis set to True, the control still cannot be scrolled or
typed into.

### Root Cause
- PR #36305 changed iOS interaction handling for non-UIControl views to
calculate UserInteractionEnabled from IsEnabled && !InputTransparent; PR
#36628 later centralized and extended this behavior. Editor and
CarouselView override the inherited IsEnabled mapper without invoking
the base mapping, so re-enabling updates only Editable for Editor or the
inner UICollectionView for CarouselView, leaving the outer native
interaction state disabled.


### Description of Change
- Updated MapIsEnabled in CarouselViewHandler, CarouselViewHandler2, and
EditorHandler to invoke ViewHandler.MapIsEnabled after applying their
control-specific updates, ensuring the outer native view’s interaction
state is recalculated when IsEnabled changes.
- Note: On iOS, a disabled Editor now fully blocks interaction (no
scrolling or text selection; touches pass through) instead of only
disabling edits.


### Issues Fixed
Fixes #37815


### Validated the behaviour in the following platforms
- [ ] Windows
- [ ] Android
- [x] iOS
- [x] Mac



### Output
| Before | After |
|----------|----------|
| <video
src="https://github.com/user-attachments/assets/0e78b7bf-3d8a-436f-bdb5-2eda8935f561">
| <video
src="https://github.com/user-attachments/assets/6eefec85-873f-44ea-b63e-fcd4eb7ed43c">
|
@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.

@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 Sep 12, 2026
@kubaflo
kubaflo merged commit 2729a13 into main Sep 12, 2026
2 of 12 checks passed
@kubaflo
kubaflo deleted the backport/pr-37849-to-main branch September 12, 2026 17:01
@github-actions github-actions Bot added this to the .NET 10 SR12 milestone Sep 12, 2026

@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.

AI Review Summary

@github-actions[bot] — new AI review results are available based on commit a90e91a.

Gate Inconclusive Confidence Low Platform MacCatalyst


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

Gate Result: ⚠️ INCONCLUSIVE

Platform: CATALYST · Base: main · Merge base: 3823473d

🩺 Could not verify — environment/infrastructure error. The gate ran the tests but hit an environment error (an emulator/simulator/Appium/XHarness flake, a device that would not boot, or an empty/invalid result file), so it could not record a real pass/fail. The ⚠️ ENV ERROR marks below are infrastructure, not test failures — this is not a problem with your PR. Comment /review to retry on a fresh agent.

XHarness did not produce the expected fresh result 'testResults.xml' for requested class(es) 'Microsoft.Maui.DeviceTests.CarouselViewTests' (the target tests did not run).

Test Without Fix (expect FAIL) With Fix (expect PASS)
📱 CarouselViewTests (IsEnabledUpdatesNativeInteractionStateOnBothContainerAndCollectionView) Category=CarouselView ⚠️ ENV ERROR ⚠️ ENV ERROR
📱 EditorHandlerTests (IsEnabledUpdatesNativeInteractionState) Category=Editor ⚠️ ENV ERROR ⚠️ ENV ERROR
🔴 Without fix — 📱 CarouselViewTests (IsEnabledUpdatesNativeInteractionStateOnBothContainerAndCollectionView): ⚠️ ENV ERROR · 85s

No log file found

🟢 With fix — 📱 CarouselViewTests (IsEnabledUpdatesNativeInteractionStateOnBothContainerAndCollectionView): ⚠️ ENV ERROR · 54s

No log file found

🔴 Without fix — 📱 EditorHandlerTests (IsEnabledUpdatesNativeInteractionState): ⚠️ ENV ERROR · 66s

No log file found

🟢 With fix — 📱 EditorHandlerTests (IsEnabledUpdatesNativeInteractionState): ⚠️ ENV ERROR · 57s

No log file found

⚠️ Failure Details

  • ⚠️ CarouselViewTests (IsEnabledUpdatesNativeInteractionStateOnBothContainerAndCollectionView) without fix: XHarness did not produce the expected fresh result 'testResults.xml' for requested class(es) 'Microsoft.Maui.DeviceTests.CarouselViewTests' (the target tests did not run).
  • ⚠️ EditorHandlerTests (IsEnabledUpdatesNativeInteractionState) without fix: XHarness did not produce the expected fresh result 'testResults.xml' for requested class(es) 'Microsoft.Maui.DeviceTests.EditorHandlerTests' (the target tests did not run).
  • ⚠️ CarouselViewTests (IsEnabledUpdatesNativeInteractionStateOnBothContainerAndCollectionView) with fix: XHarness did not produce the expected fresh result 'testResults.xml' for requested class(es) 'Microsoft.Maui.DeviceTests.CarouselViewTests' (the target tests did not run).
  • ⚠️ EditorHandlerTests (IsEnabledUpdatesNativeInteractionState) with fix: XHarness did not produce the expected fresh result 'testResults.xml' for requested class(es) 'Microsoft.Maui.DeviceTests.EditorHandlerTests' (the target tests did not run).
📁 Fix files reverted (3 files)
  • src/Controls/src/Core/Handlers/Items/CarouselViewHandler.iOS.cs
  • src/Controls/src/Core/Handlers/Items2/CarouselViewHandler2.iOS.cs
  • src/Core/src/Handlers/Editor/EditorHandler.iOS.cs

📋 Pre-Flight — Context & Validation

PR #38487 Pre-Flight

Issue: #37815 - Editor does not become editable when the IsEnabled property is set to True
PR: #38487 - [main] [iOS/MacCatalyst] Fix Editor and CarouselView remaining non-interactive after IsEnabled toggle
Source change: Backport of merged PR #37849 from inflight/current to main
Platform: iOS and MacCatalyst; STEP 5a testing is constrained to MacCatalyst (catalyst)
Diff base: 3823473d7d581aed7a51a9ab3d56973e12b4d1dc
Review commit: a85936663db6bdea8505749bd6eda700dae6b47f
Files changed: 3 implementation files, 2 device-test files (68 additions, 1 deletion)

Problem and Root Cause

An Editor or CarouselView initialized with IsEnabled = false remains non-interactive after it is re-enabled. Their specialized iOS MapIsEnabled implementations update only Editable or the inner UICollectionView. Because MauiTextView and the CarouselView container are not UIControl instances, the outer native view's UserInteractionEnabled remains stale.

The inherited ViewHandler.MapIsEnabled path recomputes iOS interaction state from both IsEnabled and InputTransparent. The PR's fix retains each control-specific update and then calls that inherited mapper for:

  • src/Core/src/Handlers/Editor/EditorHandler.iOS.cs
  • src/Controls/src/Core/Handlers/Items2/CarouselViewHandler2.iOS.cs (current iOS/MacCatalyst implementation)
  • src/Controls/src/Core/Handlers/Items/CarouselViewHandler.iOS.cs (explicit legacy compatibility)

Analogous existing mappings in ItemsViewHandler, RefreshViewHandler, ScrollViewHandler, and SwipeViewHandler already combine their specialized update with ViewHandler.MapIsEnabled.

Tests in the PR

  • EditorHandlerTests.IsEnabledUpdatesNativeInteractionState verifies Editable and UserInteractionEnabled transition from false to true.
  • CarouselViewTests.IsEnabledUpdatesNativeInteractionStateOnBothContainerAndCollectionView verifies the inner collection and outer container transition from false to true.
  • Both are device tests. Candidate runs must use only narrow tests selected from these changed tests, never an unfiltered project or full suite.
  • After a candidate's primary test passes, it must run the required regression command:
    pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Controls -Platform catalyst -TestFilter "Category=Editor"

Constraints and Existing State

  • The prior gate is INCONCLUSIVE because the tests could not be built or run; this is not evidence that the PR fix fails.
  • Candidate fixes must be mechanism-level alternatives to the PR's per-handler calls to ViewHandler.MapIsEnabled.
  • Candidate 2 must also avoid candidate 1's recorded approach and failure mechanism.
  • Each candidate is limited to one implementation/test pass and at most one focused correction/retest.
  • The worktree contains substantial pre-existing unrelated changes. They must remain untouched. The try-fix baseline/restore script is the only permitted restoration mechanism.
  • GitHub CLI authentication is unavailable in this environment; local git and the unauthenticated public API supplied the context above.

🔬 Code Review — Deep Analysis

Expert PR Evaluation — PR #38487

Code-merit verdict: LGTM
Confidence: low

Independent Assessment

What this changes: The iOS/MacCatalyst Editor and both CarouselView handlers retain their control-specific IsEnabled updates, then invoke ViewHandler.MapIsEnabled so the outer native view's interaction state is recomputed from the current IsEnabled and InputTransparent values. The device tests exercise the reported disabled-to-enabled transition for Editor and the current CarouselViewHandler2.

Inferred motivation: The specialized mappers replace the inherited mapper entry. Before this change they updated MauiTextView.Editable or the inner UICollectionView, but left UserInteractionEnabled stale on non-UIControl native views, preventing touch delivery after re-enabling.

Approach assessment: The implementation is sound. It preserves each specialized native update and delegates outer interaction-state ownership to the existing shared mapper rather than duplicating the IsEnabled && !InputTransparent calculation. Existing ItemsViewHandler implementations use the same composition pattern, and both the current and legacy iOS CarouselView handlers are covered in the implementation.

Reconciliation with PR Context

The submitted diff matches the stated backport and root cause. The public review surfaces contained one approval with an empty body, no inline comments, and no prior error-level findings to reconcile.

Blast Radius and Failure-Mode Probing

  • Runs for all instances: The extra shared-map call runs whenever IsEnabled maps for these handlers; it only recomputes native interaction state from current virtual-view state.
  • Startup impact: No new startup path or eager initialization is introduced.
  • Static/shared state: None.
  • Disconnect/reconnect: The mapper performs no subscriptions or retained state. Null platform/controller paths remain guarded.
  • InputTransparent interaction: The shared iOS mapper recomputes UserInteractionEnabled from both properties, so re-enabling does not incorrectly make an input-transparent view interactive.
  • Adjacent CarouselView behavior: The change does not alter scrolling, selection, loop state, layout, or controller lifecycle; it only synchronizes the outer touch gate and inner collection state.
  • Legacy/current handlers: Both Items/ and Items2/ implementations receive the same fix. The added CarouselView test directly exercises Items2, while the legacy path relies on the identical mapper composition.

Findings

The expert reviewer produced no actionable inline findings. inline-findings.json contains [].

External Output Contract

Not applicable.

Validation Evidence

The trusted Gate is INCONCLUSIVE because XHarness did not produce fresh results for either targeted MacCatalyst device test. This is an environment block, not a test failure. The code-merit verdict is therefore favorable, but confidence remains low because the platform behavior was not executed successfully.


🛠️ Try-Fix — Analysis & Comparison

PR #38487 — Aggregate Try-Fix Results

Candidate 1 — Direct Interaction-State Synchronization

Model: gpt-5.3-codex
Result: Blocked
Self-review: 0 findings

Approach

Retain the specialized Editor and CarouselView updates, but directly set each outer platform view's UserInteractionEnabled from IsEnabled && !InputTransparent. This is distinct from the PR's per-handler calls to ViewHandler.MapIsEnabled: it performs local native property assignments instead of re-entering the shared base mapper.

Diff

# no code diff produced

Test Results

  • Baseline setup failed because the worktree had substantial pre-existing tracked changes; no safe RevertedFiles allow-list was created.
  • Primary narrow MacCatalyst device test was not run.
  • Mandatory Controls Category=Editor MacCatalyst regression test was skipped because the primary test did not pass.
  • Required script-only restore ran and found no baseline state; no candidate edits had been made.

Failure Analysis

The environment prevented legal implementation and testing under the try-fix restoration boundary. This is a Blocked candidate, not a functional failure of the proposed approach. Candidate 2 must avoid both the PR's base-mapper re-entry and this candidate's direct per-handler UserInteractionEnabled assignment.

Candidate 2 — Re-evaluate the Interaction Dependency

Model: gpt-5.6-sol
Result: Blocked
Self-review: 0 findings

Approach

After each specialized Editor or CarouselView IsEnabled update, request:

handler.UpdateValue(nameof(IView.InputTransparent));

This causes the ordinary InputTransparent mapper to recompute outer iOS/MacCatalyst interaction state from the current IsEnabled and InputTransparent values. It differs from both prior mechanisms: it neither calls ViewHandler.MapIsEnabled nor directly assigns UserInteractionEnabled in each handler. Instead, it models interaction state as a dependent property that must be re-mapped, preserving the shared platform extension as the native-state owner.

Diff

# no code diff produced

Test Results

  • Baseline setup failed because the same pre-existing tracked changes prevented creation of a safe RevertedFiles allow-list.
  • Intended primary command was the exact EditorHandlerTests.IsEnabledUpdatesNativeInteractionState MacCatalyst device test; it was not run.
  • Mandatory Controls Category=Editor MacCatalyst regression test was skipped because the primary test did not pass.
  • Required script-only restore ran and found no baseline state; no candidate edits had been made.

Failure Analysis

The environment prevented implementation and empirical testing without endangering unrelated worktree changes. The candidate is Blocked, not Fail, and the prior gate remains INCONCLUSIVE.

Aggregate Outcome

Candidate Model Mechanism Result Primary Test Mandatory Regression
1 gpt-5.3-codex Direct per-handler outer native interaction-state assignment Blocked Not run Skipped
2 gpt-5.6-sol Re-map InputTransparent as the dependent interaction property Blocked Not run Skipped

Neither candidate produced a code diff or test evidence because the required baseline script rejected the shared dirty worktree before either implementation began. No attempt-created source changes remain.


📝 PR Finalize — Recommended Title & Description

Assessment: ✏️ Recommend updating — the current title is specific and accurate, but the description does not explain the root cause, implementation, affected handlers, regression coverage, or linked issue.

Recommended title

[main] [iOS/MacCatalyst] Fix Editor and CarouselView remaining non-interactive after IsEnabled toggle

Recommended description

Backport of #37849 to main.

### Description of Change

On iOS and Mac Catalyst, an `Editor` or `CarouselView` initialized with `IsEnabled = false` could remain non-interactive after being re-enabled. Their specialized `IsEnabled` mappers updated `MauiTextView.Editable` or the inner `UICollectionView`, but did not refresh `UserInteractionEnabled` on the outer native view that gates touch delivery.

This change preserves those control-specific updates and also invokes the shared `ViewHandler.MapIsEnabled` mapping for:

- `EditorHandler`
- the current `CarouselViewHandler2`
- the legacy `CarouselViewHandler`

The shared mapping recomputes native interaction state from both `IsEnabled` and `InputTransparent`. Device regression tests cover the disabled-to-enabled transition for `Editor` and verify both the inner collection view and outer CarouselView container.

### Issues Fixed

Fixes #37815

/cc @kubaflo @SyedAbdulAzeemSF4852

🏁 Report — Final Recommendation

✅ Final Recommendation: APPROVE

Winner: pr

The submitted PR is the strongest candidate on code merits. It preserves the specialized native updates (MauiTextView.Editable and the inner UICollectionView) and then uses the established ViewHandler.MapIsEnabled path to recompute the outer native interaction state from both IsEnabled and InputTransparent. This matches existing ItemsView handler composition, covers both current and legacy iOS/MacCatalyst CarouselView handlers, and avoids duplicating shared platform logic.

Expert Review

The one expert-review pass produced no actionable findings; inline-findings.json is an empty JSON array. The change introduces no static state, subscriptions, asynchronous work, startup behavior, or public API. Null platform/controller paths remain guarded, and the shared mapper preserves InputTransparent semantics when a control is re-enabled.

Candidate Comparison

Rank Candidate Implementation Validation Assessment
1 pr Complete submitted fix plus focused Editor and CarouselView device tests Trusted Gate INCONCLUSIVE because XHarness produced no fresh result; no functional failure observed Best: canonical shared-mapper composition, smallest maintainable change, and no expert findings
2 pr-plus-reviewer Identical to pr; reviewer patch is empty No additional validation was required because no refinement was made Equivalent behavior, but it contributes no improvement over the submitted PR
3 try-fix-2 Proposed remapping InputTransparent; no diff produced Blocked before implementation; primary and regression tests not run Indirectly triggers the desired shared state calculation through an unrelated property mapper and has no code or empirical evidence
4 try-fix-1 Proposed direct per-handler UserInteractionEnabled assignments; no diff produced Blocked before implementation; primary and regression tests not run Duplicates the shared IsEnabled && !InputTransparent policy in three handlers and has no code or empirical evidence

No candidate failed a regression test. The two try-fix candidates rank below implemented candidates because both were blocked before producing a patch or test evidence, not because their designs were proven to fail.

Why the Raw PR Wins

  1. It fixes both layers that control interaction without replacing the control-specific behavior.
  2. It keeps the shared iOS interaction-state implementation as the single source of truth.
  3. It follows existing handler precedent rather than duplicating state calculations or remapping a different property as a side effect.
  4. It includes focused regression coverage for the reported false-to-true transition.
  5. The expert reviewer identified no error, warning, or discussion item that warrants changing the submitted code.

Remaining Uncertainty

The MacCatalyst Gate is unverified because XHarness failed to produce fresh test results for both targeted tests. This is an environment failure, not a failing regression result, so it does not displace the raw PR as the winner or justify requesting code changes. Runtime confidence remains limited until CI successfully executes the device tests.


🔗 Regression Cross-Reference

🔍 Regression Cross-Reference

⚠ Overlaps with prior bug-fix PRs — same files modified, but no exact line revert detected.

File Fix PR Fixed issue(s)
src/Core/src/Handlers/Editor/EditorHandler.iOS.cs #35662 #35615
src/Core/src/Handlers/Editor/EditorHandler.iOS.cs #34617 #6972, #8422, #10107, #10509, #11113, #11677, #11808, #11812, #12131, #12324, #14566, #15057, #15280, #15559, #16522, #17127, #17323, #17550, #17664, #17864, #18367, #18481, #18669, #18679, #18843, #18933, #19074, #19219, #19331, #19642, #20383, #20392, #20596, #20682, #20855, #20922, #21037, #21240, #21646, #21700, #21791, #21828, #22060, #22565, #22887, #23030, #23832, #23903, #24241, #24252, #24511, #24603, #24866, #25010, #25081, #25093, #25728, #25920, #25921, #26158, #26633, #26864, #26975, #27143, #27250, #27302, #27427, #27646, #27846, #28078, #28101, #28147, #28421, #28722, #28824, #28901, #28961, #29191, #29192, #29415, #29428, #29484, #29547, #29645, #29704, #29729, #29764, #29812, #29930, #30004, #30066, #30097, #30181, #30273, #30290, #30605, #30782, #30888, #30979, #31109, #31121, #31140, #31145, #31387, #31551, #31966, #32017, #32243, #32266, #32316, #32406, #32416, #32578, #32791, #32807, #32983, #32989, #32995, #33119, #33131, #33258, #33291, #33293, #33304, #33375, #33415, #33417, #33420, #33424, #33493, #33547, #33577, #33601, #33604, #33614, #33635, #33648, #33650, #33672, #33706, #33769, #33772, #33904, #33909, #33947, #33954, #33964, #33969, #33972, #34021, #34073, #34114, #34119, #34122, #34165, #34210, #34211, #34246, #34257, #34336, #34343, #34419, #34464, #34480, #34591, #34635, #34636, #34661

🧪 Regression Tests to Verify

These tests were added by the overlapping fix PRs. Running them to verify no side-effect regressions:

Fix PR Type Test Filter
#35662 DeviceTest EditorTests Category=Editor

🧪 Regression Test Results

⏭️ SKIPPED — 0 passed, 0 failed, 1 skipped

Fix PR Test Type Result
#35662 EditorTests DeviceTest ⏭️ ERROR

📱 UI Tests — CollectionView,ViewBaseTests

Detected UI test categories: CollectionView,ViewBaseTests

⚠️ Deep UI tests — The deep UI run for 2 categories (CollectionView, ViewBaseTests) started (the HostApp built and dotnet test launched) but produced no results — the app failed to launch or the test host crashed before a .trx was written (an app-launch/Appium failure or an emulator flake). These categories exited quickly, well under their time budget, so raising the budget will not help — re-run the review to try again. If it recurs, check the build-output.log + logcat in the drop-deep-uitests artifact for an app-startup crash.


🧭 Next Steps — review latest findings

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

@MauiBot MauiBot added s/agent-approved AI agent recommends approval - PR fix is correct and optimal 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) and removed s/agent-review-in-progress AI review is currently running for this PR labels Sep 12, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

s/agent-approved AI agent recommends approval - PR fix is correct and optimal 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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants