diff --git a/src/SamplesApp/UITests.Shared/UITests.Shared.projitems b/src/SamplesApp/UITests.Shared/UITests.Shared.projitems index 8195fb07a00d..425b3a0553f3 100644 --- a/src/SamplesApp/UITests.Shared/UITests.Shared.projitems +++ b/src/SamplesApp/UITests.Shared/UITests.Shared.projitems @@ -2478,6 +2478,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -9566,6 +9570,9 @@ ScrollViewer_Simple.xaml + + ScrollViewer_IsIntermediate.xaml + ScrollViewer_Content_Smaller_Than_Viewport.xaml diff --git a/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/ScrollViewerTests/ScrollViewer_IsIntermediate.xaml b/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/ScrollViewerTests/ScrollViewer_IsIntermediate.xaml new file mode 100644 index 000000000000..63c8a32ef0ea --- /dev/null +++ b/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/ScrollViewerTests/ScrollViewer_IsIntermediate.xaml @@ -0,0 +1,25 @@ + + + + + Repro steps: + + 1. Scroll the ScrollViewer below using the scroll bar. You should see the status below possibly change to "Last ScrollViewerViewChangedEventArgs.IsIntermediate = true" but then it must end up on "Last ScrollViewerViewChangedEventArgs.IsIntermediate = false" + + 2. Scroll the ScrollViewer below using the mouse wheel. You should see the status below possibly change to "Last ScrollViewerViewChangedEventArgs.IsIntermediate = true" but then it must end up on "Last ScrollViewerViewChangedEventArgs.IsIntermediate = false" + + + + + + + + + diff --git a/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/ScrollViewerTests/ScrollViewer_IsIntermediate.xaml.cs b/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/ScrollViewerTests/ScrollViewer_IsIntermediate.xaml.cs new file mode 100644 index 000000000000..795d0d528627 --- /dev/null +++ b/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/ScrollViewerTests/ScrollViewer_IsIntermediate.xaml.cs @@ -0,0 +1,19 @@ +using Microsoft.UI.Xaml.Controls; +using Uno.UI.Samples.Controls; + +namespace UITests.Windows_UI_Xaml_Controls.ScrollViewerTests +{ + [Sample("Scrolling", IsManualTest = true)] + public sealed partial class ScrollViewer_IsIntermediate : Page + { + public ScrollViewer_IsIntermediate() + { + this.InitializeComponent(); + } + + private void ScrollViewer_ViewChanged(object sender, ScrollViewerViewChangedEventArgs e) + { + statusTb.Text = $"Last ScrollViewerViewChangedEventArgs.IsIntermediate = {e.IsIntermediate}"; + } + } +} diff --git a/src/Uno.UI/UI/Xaml/Controls/ScrollContentPresenter/ScrollContentPresenter.wasm.cs b/src/Uno.UI/UI/Xaml/Controls/ScrollContentPresenter/ScrollContentPresenter.wasm.cs index a77cba41f6cf..d315db50e219 100644 --- a/src/Uno.UI/UI/Xaml/Controls/ScrollContentPresenter/ScrollContentPresenter.wasm.cs +++ b/src/Uno.UI/UI/Xaml/Controls/ScrollContentPresenter/ScrollContentPresenter.wasm.cs @@ -354,8 +354,8 @@ private bool OnScroll(object sender, RoutedEventArgs routedEventArgs) var horizontalOffset = GetNativeHorizontalOffset(); var verticalOffset = GetNativeVerticalOffset(); var isIntermediate = - (_lastScrollToRequest.horizontal.HasValue && _lastScrollToRequest.horizontal.Value != horizontalOffset) || - (_lastScrollToRequest.vertical.HasValue && _lastScrollToRequest.vertical.Value != verticalOffset); + (_lastScrollToRequest.horizontal.HasValue && Math.Abs(_lastScrollToRequest.horizontal.Value - horizontalOffset) >= 1) || + (_lastScrollToRequest.vertical.HasValue && Math.Abs(_lastScrollToRequest.vertical.Value - verticalOffset) >= 1); if (!isIntermediate) { _lastScrollToRequest = (null, null);