Fix for N_SE-40699
[framework/osp/uifw.git] / src / ui / controls / FUiCtrl_SearchBar.cpp
index fe79ded..311cb6c 100644 (file)
@@ -1801,28 +1801,35 @@ _SearchBar::OnFocusLost(const _Control &source)
 bool
 _SearchBar::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
 {
-       _KeyCode keyCode = keyInfo.GetKeyCode();
+       if (!__pEdit->IsUsbKeyboardConnected())
+       {
+               return false;
+       }
 
        if (!__pEdit->IsSearchFieldFocused())
        {
                return false;
        }
 
+       _KeyCode keyCode = keyInfo.GetKeyCode();
+
        switch (keyCode)
        {
                case _KEY_RIGHT:
                        SetFocusCallbackParameter(false);
                        if (&source == __pEdit)
                        {
-                               if ((!__isButtonEnabled || !__isUsableCancelButton) && __pContentControl && __pContentControl->GetEnableState())
+                               if ((!__isButtonEnabled || !__isUsableCancelButton) && __pContentControl && __pContentControl->GetVisibleState() && __pContentControl->GetEnableState())
                                {
                                        __pContentControl->SetFocused();
                                        __pContentControl->OnDrawFocus();
 
                                        return true;
                                }
-
-                               __pCancelButton->SetFocused();
+                               else if (__isButtonEnabled && __isUsableCancelButton)
+                               {
+                                       __pCancelButton->SetFocused();
+                               }
 
                                return true;
                        }