[NUI] If the view had focus when it was unparented, the focus is cleared. (#4654)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / ViewInternal.cs
index 8135c96..9180064 100755 (executable)
@@ -1035,6 +1035,11 @@ namespace Tizen.NUI.BaseComponents
 
         internal void RemoveChild(View child)
         {
+            // If the view had focus, it clears focus.
+            if (child == FocusManager.Instance.GetCurrentFocusView())
+            {
+                FocusManager.Instance.ClearFocus();
+            }
             // Do actual child removal
             Interop.Actor.Remove(SwigCPtr, View.getCPtr(child));
             if (NDalicPINVOKE.SWIGPendingException.Pending)