1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Accessibility: Only call grabKeyboardFocus() on focusable components

This commit is contained in:
ed 2021-05-26 08:52:15 +01:00
parent edd4ff9cfc
commit fd8c6ce15c

View file

@ -319,8 +319,12 @@ void AccessibilityHandler::takeFocus()
currentlyFocusedHandler = this;
notifyAccessibilityEventInternal (*this, InternalAccessibilityEvent::focusChanged);
if (component.getWantsKeyboardFocus() && ! component.hasKeyboardFocus (true))
if ((component.isShowing() || component.isOnDesktop())
&& component.getWantsKeyboardFocus()
&& ! component.hasKeyboardFocus (true))
{
component.grabKeyboardFocus();
}
}
//==============================================================================