diff --git a/common/widgets/unit_binder.cpp b/common/widgets/unit_binder.cpp index 708281600f..1a103eca0d 100644 --- a/common/widgets/unit_binder.cpp +++ b/common/widgets/unit_binder.cpp @@ -642,5 +642,13 @@ void PROPERTY_EDITOR_UNIT_BINDER::SetControl( wxWindow* aControl ) nullptr, this ); m_valueCtrl->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( PROPERTY_EDITOR_UNIT_BINDER::onClick ), nullptr, this ); + m_valueCtrl->Bind( wxEVT_SET_FOCUS, &PROPERTY_EDITOR_UNIT_BINDER::onSetFocus, this ); + + m_valueCtrl->Bind( wxEVT_SHOW, + [&]( wxShowEvent& e ) + { + if( !e.IsShown() ) + SetControl( nullptr ); + } ); } }