Skip to content

[WIP][Revert][Android] Fix CollectionView inside disabled RefreshView blocks scroll#36715

Draft
SyedAbdulAzeemSF4852 wants to merge 2 commits into
dotnet:mainfrom
SyedAbdulAzeemSF4852:revert-34702-restore-cascading-isenabled
Draft

[WIP][Revert][Android] Fix CollectionView inside disabled RefreshView blocks scroll#36715
SyedAbdulAzeemSF4852 wants to merge 2 commits into
dotnet:mainfrom
SyedAbdulAzeemSF4852:revert-34702-restore-cascading-isenabled

Conversation

@SyedAbdulAzeemSF4852

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!

Description of Change

  • Reverts the IsExplicitlyEnabled carve-out introduced in PR [Android] Fix CollectionView inside disabled RefreshView blocks scroll #34702, which bypassed VisualElement's built-in IsEnabled cascading (via CoerceIsEnabledProperty) specifically for ItemsView touch handling on Android and iOS. This restores the default behavior, where disabling a parent (for example, RefreshView.IsEnabled = false) also disables touch interaction for its child views (for example, CollectionView).

Reason

IsEnabled cascading from parent to child is expected, by-design behavior — VisualElement.IsEnabledCore (src/Controls/src/Core/VisualElement/VisualElement.cs) coerces a child's IsEnabled to false whenever any ancestor is disabled.

Issue #34666 was filed with an "Expected Behavior" of "Page C6 can scroll" — but the C6 manual test's own written pass-criteria only checks that the refresh spinner does not appear; it never specifies that the CollectionView must remain scrollable. The reporter's expectation goes beyond what C6 actually tests for, and contradicts IsEnabled 's cascading behavior (per IsEnabledCore) — the correct API for "block only the refresh gesture, keep content interactive" is RefreshView.IsRefreshEnabled = false , not IsEnabled = false .

Changes

  • VisualElement.cs: Removed the IsExplicitlyEnabled property entirely.
  • MauiRecyclerView.cs (Android): Reverted OnTouchEvent, DispatchTouchEvent, and OnInterceptTouchEvent to check plain IsEnabled instead of IsEnabled && !IsExplicitlyEnabled, restoring cascading block behavior.
  • SelectableItemsViewController.cs / SelectableItemsViewController2.cs (iOS): Reverted ItemSelected, ItemDeselected, and UpdateSelectionMode to use IsEnabled instead of IsExplicitlyEnabled.
  • MauiSwipeRefreshLayout.cs (Android): Added an !Enabled guard in OnInterceptTouchEvent so a disabled SwipeRefreshLayout correctly blocks touch interception.
  • Issue34666.cs (both TestCases.Shared.Tests and TestCases.HostApp): Updated to reflect the restored, correct behavior:
    • Extended the #if guard from Windows-only (TEST_FAILS_ON_WINDOWS) to ANDROID || WINDOWS, since both platforms now correctly block scrolling.
    • Renamed CollectionViewScrollsWhenRefreshViewDisabled → CollectionViewDoesNotScrollWhenRefreshViewDisabled.
    • Changed the final assertion from "Gelada" (requires successful scroll) to "Baboon" (confirms scroll is blocked).
    • Updated the Issue description from "The C6 page cannot scroll on Windows and Android platforms" to "Disabling RefreshView cascades IsEnabled = false to its child CollectionView, preventing scrolling" since this is now the intended, correct behavior rather than an open bug.

Issues Fixed

Relates to #34666 — the underlying report is describing IsEnabled 's expected, by-design cascading behavior, not a bug; the correct fix for the reporter's actual use case is IsRefreshEnabled = false , not IsEnabled = false.

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

Or

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

@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 community ✨ Community Contribution label Jul 22, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

@dotnet-policy-service dotnet-policy-service Bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant