X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c9f7896861f734ce044ee8601ba2d8a6959c9d9e..633566f6ef1729066b478918d963762f90dbae37:/src/msw/choice.cpp diff --git a/src/msw/choice.cpp b/src/msw/choice.cpp index e7d100a954..4af53089a6 100644 --- a/src/msw/choice.cpp +++ b/src/msw/choice.cpp @@ -722,6 +722,13 @@ bool wxChoice::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) // need to reset the selection back to it if it's eventually // cancelled by user m_lastAcceptedSelection = GetCurrentSelection(); + if ( m_lastAcceptedSelection == -1 ) + { + // no current selection so no need to restore it later (this + // happens when opening a combobox containing text not from its + // list of items and we shouldn't erase this text) + m_lastAcceptedSelection = wxID_NONE; + } break; case CBN_CLOSEUP: