Browse Source

Accessibility: Fixed some focus issues with modal components

v6.1.6
ed 4 years ago
parent
commit
df4ff3b225
2 changed files with 3 additions and 5 deletions
  1. +3
    -2
      modules/juce_gui_basics/accessibility/juce_AccessibilityHandler.cpp
  2. +0
    -3
      modules/juce_gui_basics/components/juce_Component.cpp

+ 3
- 2
modules/juce_gui_basics/accessibility/juce_AccessibilityHandler.cpp View File

@@ -310,8 +310,9 @@ void AccessibilityHandler::giveAwayFocusInternal() const
{
currentlyFocusedHandler = nullptr;
if (auto* parent = getParent())
notifyAccessibilityEventInternal (*parent, InternalAccessibilityEvent::focusChanged);
if (auto* focusedComponent = Component::getCurrentlyFocusedComponent())
if (auto* handler = focusedComponent->getAccessibilityHandler())
handler->grabFocus();
}
void AccessibilityHandler::takeFocus()


+ 0
- 3
modules/juce_gui_basics/components/juce_Component.cpp View File

@@ -1709,9 +1709,6 @@ void Component::enterModalState (bool shouldTakeKeyboardFocus,
if (shouldTakeKeyboardFocus)
grabKeyboardFocus();
if (auto* handler = getAccessibilityHandler())
notifyAccessibilityEventInternal (*handler, InternalAccessibilityEvent::focusChanged);
}
else
{


Loading…
Cancel
Save