Revert "Fix focus issue after calling ClearFocus api"
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / focus-manager / keyboard-focus-manager-impl.cpp
index a20808c..3555b3c 100644 (file)
@@ -673,9 +673,12 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
           // Show focus indicator
           mIsFocusIndicatorEnabled = 1;
         }
+        else
+        {
+          // Move the focus towards left
+          MoveFocus(Toolkit::Control::KeyboardFocus::LEFT);
+        }
 
-        // Move the focus towards left
-        MoveFocus(Toolkit::Control::KeyboardFocus::LEFT);
         isFocusStartableKey = true;
       }
       else
@@ -693,9 +696,11 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
           // Show focus indicator
           mIsFocusIndicatorEnabled = 1;
         }
-
-        // Move the focus towards right
-        MoveFocus(Toolkit::Control::KeyboardFocus::RIGHT);
+        else
+        {
+          // Move the focus towards right
+          MoveFocus(Toolkit::Control::KeyboardFocus::RIGHT);
+        }
       }
       else
       {
@@ -712,9 +717,12 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
         // Show focus indicator
         mIsFocusIndicatorEnabled = 1;
       }
+      else
+      {
+        // Move the focus towards up
+        MoveFocus(Toolkit::Control::KeyboardFocus::UP);
+      }
 
-      // Move the focus towards up
-      MoveFocus(Toolkit::Control::KeyboardFocus::UP);
       isFocusStartableKey = true;
     }
     else if (keyName == "Down" && !isAccessibilityEnabled)
@@ -724,9 +732,12 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
         // Show focus indicator
         mIsFocusIndicatorEnabled = 1;
       }
+      else
+      {
+        // Move the focus towards down
+        MoveFocus(Toolkit::Control::KeyboardFocus::DOWN);
+      }
 
-      // Move the focus towards down
-      MoveFocus(Toolkit::Control::KeyboardFocus::DOWN);
       isFocusStartableKey = true;
     }
     else if (keyName == "Prior" && !isAccessibilityEnabled)
@@ -736,9 +747,11 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
         // Show focus indicator
         mIsFocusIndicatorEnabled = 1;
       }
-
-      // Move the focus towards the previous page
-      MoveFocus(Toolkit::Control::KeyboardFocus::PAGE_UP);
+      else
+      {
+        // Move the focus towards the previous page
+        MoveFocus(Toolkit::Control::KeyboardFocus::PAGE_UP);
+      }
 
       isFocusStartableKey = true;
     }
@@ -749,9 +762,11 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
         // Show focus indicator
         mIsFocusIndicatorEnabled = 1;
       }
-
-      // Move the focus towards the next page
-      MoveFocus(Toolkit::Control::KeyboardFocus::PAGE_DOWN);
+      else
+      {
+        // Move the focus towards the next page
+        MoveFocus(Toolkit::Control::KeyboardFocus::PAGE_DOWN);
+      }
 
       isFocusStartableKey = true;
     }