Skip to content

Commit cc25877

Browse files
devanathan-vaithiyanathanPureWeen
authored andcommitted
[Catalyst] Fix Scrollbar does not align with FlowDirection change in ScrollView (#30241)
* fix added * Revert "fix added" This reverts commit 138797f. * fix added * fix updated
1 parent 3314276 commit cc25877

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Core/src/Platform/iOS/MauiScrollView.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,20 @@ public override void LayoutSubviews()
5858
// arrangement with an adjusted starting point and recalculating the content offset.
5959
if (_previousEffectiveUserInterfaceLayoutDirection != EffectiveUserInterfaceLayoutDirection)
6060
{
61+
// In mac platform, Scrollbar is not updated based on FlowDirection, so resetting the scroll indicators
62+
// It's a native limitation; to maintain platform consistency, a hack fix is applied to show the Scrollbar based on the FlowDirection.
63+
if (OperatingSystem.IsMacCatalyst() && _previousEffectiveUserInterfaceLayoutDirection is not null)
64+
{
65+
bool showsVertical = ShowsVerticalScrollIndicator;
66+
bool showsHorizontal = ShowsHorizontalScrollIndicator;
67+
68+
ShowsVerticalScrollIndicator = false;
69+
ShowsHorizontalScrollIndicator = false;
70+
71+
ShowsVerticalScrollIndicator = showsVertical;
72+
ShowsHorizontalScrollIndicator = showsHorizontal;
73+
}
74+
6175
if (EffectiveUserInterfaceLayoutDirection == UIUserInterfaceLayoutDirection.RightToLeft)
6276
{
6377
var horizontalOffset = contentSize.Width - crossPlatformBounds.Width;

0 commit comments

Comments
 (0)