When the view is unparented, the focus is not cleared.
So, when app re-add the view and SetCurrentFocusView, app do not receiving the FocusGained event.
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)
Tizen.Log.Error("NUI", "You have deleted a view that is not a child of this layer.");
return;
}
+ // If the view had focus, it clears focus.
+ if (child == FocusManager.Instance.GetCurrentFocusView())
+ {
+ FocusManager.Instance.ClearFocus();
+ }
+
Interop.Actor.Remove(SwigCPtr, View.getCPtr(child));
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();