I have a CEF application based on the cefclient example.
After calling alert( "anything" ) in javascript and clicking OK to dismiss the alert dialog box, I cannot focus on any <input type="text"...> element, either by clicking the element, or by using the tab key. I *am* able to drag to select text that is already in the element, and the text highlights in gray as if the control is disabled. (I can also copy this gray text once it's selected.) I am able to use other controls check as check boxes and <select> controls.
HOWEVER, when I switch to another application (either using the taskbar or alt-tab) and then back to the CEF application, the text inputs behave normally again.
At first I thought this might be due to me having an override js dialog box handler:
- Code: Select all
CefRefPtr<CefJSDialogHandler> GetJSDialogHandler() OVERRIDE {
return this->_myJSdialogHandler;
}
bool MyJSDialogHandler::OnJSDialog(CefRefPtr<CefBrowser> browser,
const CefString& origin_url,
JSDialogType dialog_type,
const CefString& message_text,
const CefString& default_prompt_text,
CefRefPtr<CefJSDialogCallback> callback,
bool& suppress_message)
{
switch ( dialog_type )
{
case JSDIALOGTYPE_ALERT:
{
MessageBox( browser->GetHost()->GetWindowHandle(), message_text.c_str(), L"My Application", MB_OK );
callback->Continue( true, "" );
return true;
}
case JSDIALOGTYPE_CONFIRM:
{
int r = MessageBox( browser->GetHost()->GetWindowHandle(), message_text.c_str(), L"My Appliction", MB_OKCANCEL );
callback->Continue( ( r == IDOK ), "" );
return true;
}
}
return false;
}
However, even when I comment out my handler and use the default CEF alert box I get the same problem.