[NUI] Fix ScrollableBase animation issue
authorhuiyu.eun <huiyu.eun@samsung.com>
Fri, 28 May 2021 03:22:56 +0000 (12:22 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Tue, 1 Jun 2021 08:03:31 +0000 (17:03 +0900)
https://github.sec.samsung.net/dotnet/NUIBackend/issues/56
- Stop scroll animation when ScrollTo() is called during scrolling
- Stop scroll animation when changing ScrollDirection

Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
src/Tizen.NUI.Components/Controls/ScrollableBase.cs

index a0796c5..93381a7 100755 (executable)
@@ -260,6 +260,9 @@ namespace Tizen.NUI.Components
             {
                 if (value != mScrollingDirection)
                 {
+                    //Reset scroll position and stop scroll animation
+                    ScrollTo(0, false);
+
                     mScrollingDirection = value;
                     mPanGestureDetector.ClearAngles();
                     mPanGestureDetector.AddDirection(value == Direction.Horizontal ?
@@ -987,6 +990,7 @@ namespace Tizen.NUI.Components
             }
             else
             {
+                StopScroll();
                 finalTargetPosition = BoundScrollPosition(childTargetPosition);
 
                 // Set position of scrolling child without an animation