diff --git a/modules/juce_gui_basics/windows/juce_ComponentPeer.cpp b/modules/juce_gui_basics/windows/juce_ComponentPeer.cpp index a4171f16a0..c27692bb0e 100644 --- a/modules/juce_gui_basics/windows/juce_ComponentPeer.cpp +++ b/modules/juce_gui_basics/windows/juce_ComponentPeer.cpp @@ -275,8 +275,8 @@ TextInputTarget* ComponentPeer::findCurrentTextInputTarget() { Component* const c = Component::getCurrentlyFocusedComponent(); - if (component.isParentOf (c)) - if (TextInputTarget* const ti = dynamic_cast (c)) + if (c == &component || component.isParentOf (c)) + if (TextInputTarget* const ti = dynamic_cast (c)) if (ti->isTextInputActive()) return ti;