diff --git a/src/surge-xt/gui/widgets/TypeAheadTextEditor.cpp b/src/surge-xt/gui/widgets/TypeAheadTextEditor.cpp index 6cc9d44faaf..27c3b37cd44 100644 --- a/src/surge-xt/gui/widgets/TypeAheadTextEditor.cpp +++ b/src/surge-xt/gui/widgets/TypeAheadTextEditor.cpp @@ -217,5 +217,11 @@ void TypeAhead::colourChanged() if (isColourSpecified(ColourIds::borderid)) lbox->setColour(juce::ListBox::ColourIds::outlineColourId, findColour(ColourIds::borderid)); } +void TypeAhead::focusLost(juce::Component::FocusChangeType type) +{ + lbox->setVisible(false); + for (auto l : taList) + l->typeaheadCanceled(); +} } // namespace Widgets } // namespace Surge \ No newline at end of file diff --git a/src/surge-xt/gui/widgets/TypeAheadTextEditor.h b/src/surge-xt/gui/widgets/TypeAheadTextEditor.h index 571925e3c27..509a9d847cc 100644 --- a/src/surge-xt/gui/widgets/TypeAheadTextEditor.h +++ b/src/surge-xt/gui/widgets/TypeAheadTextEditor.h @@ -72,6 +72,8 @@ struct TypeAhead : public juce::TextEditor, juce::TextEditor::Listener void parentHierarchyChanged() override; void textEditorTextChanged(juce::TextEditor &editor) override; + void focusLost(FocusChangeType type) override; + bool setToElementZeroOnReturn{false}; void textEditorReturnKeyPressed(juce::TextEditor &editor) override; void textEditorEscapeKeyPressed(juce::TextEditor &editor) override;