Project

General

Profile

setFocus(false)

Added by Ben Jackson over 11 years ago

void MyWidget::handleEscapePressed() {
    _textArea->setText("I HAVE NO FOCUS!");    
    _textArea->setFocus(false);
}

If I wire this code up to _textArea->escapePressed(), the text in the textarea changes to "I HAVE NO FOCUS!", but the focus doesn't actually change. I would like to remove focus from everything so that control goes back to my globalKeyPressed handlers.

Any suggestions? (Still using 3.2.1, clients are IE9, FF16 and Chrome22 on Windows 7)


Replies (1)

RE: setFocus(false) - Added by Koen Deforche over 11 years ago

Hey,

setFocus(false) indeed does not work as intended.

As a workaround, doJavaScript("document.activeElement.blur();") should probably work ?

Regards,

koen

    (1-1/1)