diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34583.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34583.cs index 79463f0b8b5c..8b735d83e245 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34583.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34583.cs @@ -1,3 +1,4 @@ +#if TEST_FAILS_ON_WINDOWS // Issue link: https://github.com/dotnet/maui/issues/34671 using System.Globalization; using NUnit.Framework; using UITest.Appium; @@ -40,3 +41,4 @@ public void ScrollPositionIsPreservedWhenOrientationChangesToNeither() Assert.That(scrollY, Is.GreaterThan(0d), "ScrollY should remain non-zero after setting orientation to Neither."); } } +#endif \ No newline at end of file diff --git a/src/Core/src/Platform/Windows/ScrollViewerExtensions.cs b/src/Core/src/Platform/Windows/ScrollViewerExtensions.cs index 5b716146f673..46487d6c911f 100644 --- a/src/Core/src/Platform/Windows/ScrollViewerExtensions.cs +++ b/src/Core/src/Platform/Windows/ScrollViewerExtensions.cs @@ -20,21 +20,10 @@ public static void UpdateScrollBarVisibility(this ScrollViewer scrollViewer, Scr { if (orientation == ScrollOrientation.Neither) { - // Use Hidden (not Disabled) so WinUI keeps the current ContentOffset instead of - // resetting it to (0,0). ScrollMode.Disabled prevents further user scrolling while - // the orientation is Neither. - scrollViewer.HorizontalScrollBarVisibility = WScrollBarVisibility.Hidden; - scrollViewer.VerticalScrollBarVisibility = WScrollBarVisibility.Hidden; - scrollViewer.HorizontalScrollMode = ScrollMode.Disabled; - scrollViewer.VerticalScrollMode = ScrollMode.Disabled; + scrollViewer.HorizontalScrollBarVisibility = scrollViewer.VerticalScrollBarVisibility = WScrollBarVisibility.Disabled; return; } - // When leaving Neither, restore scroll modes to Auto so that they follow - // the ScrollBarVisibility settings applied below. - scrollViewer.HorizontalScrollMode = ScrollMode.Auto; - scrollViewer.VerticalScrollMode = ScrollMode.Auto; - if (visibility == ScrollBarVisibility.Default) { // If the user has not explicitly set a horizontal scroll bar visibility, then the orientation will