diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 7b1bffec79..6e989ae648 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -2074,12 +2074,14 @@ void wxListTextCtrl::OnChar( wxKeyEvent &event ) switch ( event.m_keyCode ) { case WXK_RETURN: - if ( !AcceptChanges() ) + if ( AcceptChanges() ) { - // vetoed by the user code - break; + // Close the text control, changes were accepted + Finish(); } - //else: fall through + // else do nothing, do not accept and do not close + + break; case WXK_ESCAPE: Finish();