Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Controls/src/Core/Handlers/Items/ItemsViewHandler.iOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ protected virtual void UpdateLayout()
internal static void MapIsEnabled(ItemsViewHandler<TItemsView> handler, ItemsView itemsView)
{
(handler.Controller as SelectableItemsViewController<ReorderableItemsView>)?.UpdateSelectionMode();

// Funnel through the base handler's IsEnabled mapping so UserInteractionEnabled
// stays correctly derived from both IsEnabled and InputTransparent.
ViewHandler.MapIsEnabled(handler, itemsView);
}

protected virtual void ScrollToRequested(object sender, ScrollToRequestEventArgs args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ public static void MapIsVisible(ItemsViewHandler2<TItemsView> handler, ItemsView
internal static void MapIsEnabled(ItemsViewHandler2<TItemsView> handler, ItemsView itemsView)
{
(handler.Controller as SelectableItemsViewController2<ReorderableItemsView>)?.UpdateSelectionMode();

// Funnel through the base handler's IsEnabled mapping so UserInteractionEnabled
// stays correctly derived from both IsEnabled and InputTransparent.
ViewHandler.MapIsEnabled(handler, itemsView);
}

public static void MapItemsUpdatingScrollMode(ItemsViewHandler2<TItemsView> handler, ItemsView itemsView)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if TEST_FAILS_ON_WINDOWS // The issue also affects Windows; tracked for follow-up in: https://github.com/dotnet/maui/issues/34701
#if TEST_FAILS_ON_ANDROID
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;
Expand All @@ -20,7 +20,7 @@ public void CollectionViewScrollsWhenRefreshViewDisabled()
App.WaitForElement("Baboon");
App.ScrollDown("CollectionView");
App.ScrollDown("CollectionView");
App.WaitForElement("Gelada");
App.WaitForElement("Baboon");
}
}
#endif
8 changes: 7 additions & 1 deletion src/Core/src/Handlers/RefreshView/RefreshViewHandler.iOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,13 @@ internal static void MapIsRefreshEnabled(IRefreshViewHandler handler, IRefreshVi
=> handler.PlatformView.UpdateIsRefreshEnabled(refreshView.IsRefreshEnabled);

public static void MapIsEnabled(IRefreshViewHandler handler, IRefreshView refreshView)
=> handler.PlatformView.UpdateIsEnabled(refreshView.IsEnabled);
{
handler.PlatformView!.UpdateIsEnabled(refreshView.IsEnabled);

// Also funnel through the base handler's IsEnabled mapping so UserInteractionEnabled
// stays correctly derived from both IsEnabled and InputTransparent.
ViewHandler.MapIsEnabled(handler, refreshView);
}

static void UpdateContent(IRefreshViewHandler handler)
{
Expand Down
5 changes: 5 additions & 0 deletions src/Core/src/Handlers/ScrollView/ScrollViewHandler.iOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ public static void MapContentSize(IScrollViewHandler handler, IScrollView scroll
public static void MapIsEnabled(IScrollViewHandler handler, IScrollView scrollView)
{
handler.PlatformView?.UpdateIsEnabled(scrollView);

// Also funnel through the base handler's IsEnabled mapping so UserInteractionEnabled
// stays correctly derived from both IsEnabled and InputTransparent, not just
// ScrollEnabled (which is all the ScrollView-specific overload above sets).
ViewHandler.MapIsEnabled(handler, scrollView);
}

public static void MapHorizontalScrollBarVisibility(IScrollViewHandler handler, IScrollView scrollView)
Expand Down
19 changes: 14 additions & 5 deletions src/Core/src/Platform/iOS/ViewExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,22 @@ public static void UpdateIsEnabled(this UIView platformView, IView view)
}
else
{
// Non-UIControl views (like UICollectionView) only get interaction disable
platformView.UserInteractionEnabled = view.IsEnabled && !view.InputTransparent;
// UserInteractionEnabled is the single source of truth, always
// recomputed here from both IsEnabled and InputTransparent.
platformView.UpdateInteractionState(view);
}
}

// Single owner of UserInteractionEnabled: both UpdateIsEnabled and
// UpdateInputTransparent funnel through this so the flag is always
// recomputed from current state, never left stale by either one.
static void UpdateInteractionState(this UIView platformView, IView view)
{
platformView.UserInteractionEnabled = platformView is UIControl
? !view.InputTransparent
: view.IsEnabled && !view.InputTransparent;
}

public static void Focus(this UIView platformView, FocusRequest request)
{
request.TrySetResult(platformView.BecomeFirstResponder());
Expand Down Expand Up @@ -626,9 +637,7 @@ public static void UpdateInputTransparent(this UIView platformView, IViewHandler
return;
}

platformView.UserInteractionEnabled = platformView is UIControl
? !view.InputTransparent
: view.IsEnabled && !view.InputTransparent;
platformView.UpdateInteractionState(view);
}

public static void UpdateInputTransparent(this UIView platformView, bool isReadOnly, bool inputTransparent)
Expand Down
Loading