From c29ddf7681e0dd3bea552824572ea0a809cf30af Mon Sep 17 00:00:00 2001 From: ed Date: Wed, 9 Jun 2021 16:23:02 +0100 Subject: [PATCH] Accessibility: Return non-focusable AccessibleState from LabelAccessibilityHandler::getCurrentState() when the TextEditor is showing and active so focus is passed through correctly --- modules/juce_gui_basics/widgets/juce_Label.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/juce_gui_basics/widgets/juce_Label.cpp b/modules/juce_gui_basics/widgets/juce_Label.cpp index 11fb9264cd..4c5d53f43c 100644 --- a/modules/juce_gui_basics/widgets/juce_Label.cpp +++ b/modules/juce_gui_basics/widgets/juce_Label.cpp @@ -535,6 +535,14 @@ public: return label.getText(); } + AccessibleState getCurrentState() const override + { + if (label.isBeingEdited()) + return {}; // allow focus to pass through to the TextEditor + + return AccessibilityHandler::getCurrentState(); + } + private: class LabelValueInterface : public AccessibilityTextValueInterface {