1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-16 00:34:19 +00:00

Added some notes and an assertion to Component::grabKeyboardFocus(), to help people avoid a common mistake, which is trying to grab the focus of not-yet-visible components.

This commit is contained in:
jules 2017-03-28 10:44:52 +01:00
parent 3b2014a5db
commit e253b8bea1
3 changed files with 49 additions and 37 deletions

View file

@ -728,7 +728,7 @@ bool ProjectContentComponent::showDocument (OpenDocumentManager::Document* doc,
bool opened = setEditorComponent (doc->createEditor(), doc);
if (opened && grabFocus)
if (opened && grabFocus && isShowing())
contentView->grabKeyboardFocus();
return opened;