Hi Jules,
I noticed that ComponentPeer::HandleKeyPress returns unconditionally on Tab press.
Whether the following code should check for keyWasUsed flag before breaking the call chain?
// @file: juce_ComponentPeer.cpp
bool ComponentPeer::handleKeyPress (const int keyCode, const juce_wchar textCharacter)
{
...
...
for (Component* target = getTargetForKeyPress(); target != nullptr; target = target->getParentComponent())
{
...
...
if (Component* const currentlyFocused = Component::getCurrentlyFocusedComponent())
{
const bool isTab = (keyInfo == KeyPress::tabKey);
const bool isShiftTab = (keyInfo == KeyPress (KeyPress::tabKey, ModifierKeys::shiftModifier, 0));
if (isTab || isShiftTab)
{
currentlyFocused->moveKeyboardFocusToSibling (isTab);
keyWasUsed = (currentlyFocused != Component::getCurrentlyFocusedComponent());
break; // We should break only if keyWasUsed is set.
}
}
}
return keyWasUsed;
}