Repository navigation
[main] [iOS/MacCatalyst] Fix Editor and CarouselView remaining non-interactive after IsEnabled toggle - #38487
Conversation
…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: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
This comment has been minimized.
This comment has been minimized.
MauiBot
left a comment
There was a problem hiding this comment.
AI Review Summary
@github-actions[bot] — new AI review results are available based on commit
a90e91a.
🗂️ 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 /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 |
||
📱 EditorHandlerTests (IsEnabledUpdatesNativeInteractionState) Category=Editor |
🔴 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.cssrc/Controls/src/Core/Handlers/Items2/CarouselViewHandler2.iOS.cssrc/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.cssrc/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.IsEnabledUpdatesNativeInteractionStateverifiesEditableandUserInteractionEnabledtransition from false to true.CarouselViewTests.IsEnabledUpdatesNativeInteractionStateOnBothContainerAndCollectionViewverifies 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
IsEnabledmaps 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.
InputTransparentinteraction: The shared iOS mapper recomputesUserInteractionEnabledfrom 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/andItems2/implementations receive the same fix. The added CarouselView test directly exercisesItems2, 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 producedTest Results
- Baseline setup failed because the worktree had substantial pre-existing tracked changes; no safe
RevertedFilesallow-list was created. - Primary narrow MacCatalyst device test was not run.
- Mandatory Controls
Category=EditorMacCatalyst 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 producedTest Results
- Baseline setup failed because the same pre-existing tracked changes prevented creation of a safe
RevertedFilesallow-list. - Intended primary command was the exact
EditorHandlerTests.IsEnabledUpdatesNativeInteractionStateMacCatalyst device test; it was not run. - Mandatory Controls
Category=EditorMacCatalyst 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
- It fixes both layers that control interaction without replacing the control-specific behavior.
- It keeps the shared iOS interaction-state implementation as the single source of truth.
- It follows existing handler precedent rather than duplicating state calculations or remapping a different property as a side effect.
- It includes focused regression coverage for the reported false-to-true transition.
- 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.
🧪 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
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.
Backport of #37849 to main
/cc @kubaflo @SyedAbdulAzeemSF4852