[NUI] Fix ScrollBar Unparent bug
authorhuiyu.eun <huiyu.eun@samsung.com>
Tue, 22 Dec 2020 07:23:48 +0000 (16:23 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Tue, 22 Dec 2020 08:57:34 +0000 (17:57 +0900)
ScrollBar.Unparent() is not working.

ScrollBar.Unparent() -> ScrollableBase.Remove(view)
Remove() of ScrollableBase is overridden to be removed based on ContentContainer.

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

index 85afae9..90efec2 100755 (executable)
@@ -1353,6 +1353,11 @@ namespace Tizen.NUI.Components
             }
         }
 
+        internal void BaseRemove(View view)
+        {
+            base.Remove(view);
+        }
+
         internal override bool OnAccessibilityPan(PanGesture gestures)
         {
             if (SnapToPage && scrollAnimation != null && scrollAnimation.State == Animation.States.Playing)
index 988651c..a23b9cd 100755 (executable)
@@ -59,6 +59,14 @@ namespace Tizen.NUI.Components
         #region Methods
 
         /// <summary>
+        /// Removes a view from its parent ScrollableBase. If a view has no parent, this method does nothing.
+        /// </summary>
+        public new void Unparent()
+        {
+            (GetParent() as ScrollableBase)?.BaseRemove(this);
+        }
+
+        /// <summary>
         /// Update content length and position at once.
         /// </summary>
         /// <param name="contentLength">The total length of the content.</param>