From 19f9f6af57e654513c842ba47104e287757e96b5 Mon Sep 17 00:00:00 2001 From: Hartwig Date: Sun, 18 Oct 2020 00:52:22 +0200 Subject: [PATCH] Mark wxTextCtrl dirty before handling event in wxOSX This fixes behaviour of wxSpinCtrl which otherwise could still use the old value of its text part when processing spin buttons press. Closes https://github.com/wxWidgets/wxWidgets/pull/2092 --- src/osx/cocoa/window.mm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm index 619915b4d9..e9e82814d0 100644 --- a/src/osx/cocoa/window.mm +++ b/src/osx/cocoa/window.mm @@ -2443,7 +2443,10 @@ void wxWidgetCocoaImpl::controlTextDidChange() wxTextCtrl *tc = wxDynamicCast( wxpeer , wxTextCtrl ); wxComboBox *cb = wxDynamicCast( wxpeer , wxComboBox ); if ( tc ) + { + tc->MarkDirty(); tc->SendTextUpdatedEventIfAllowed(); + } else if ( cb ) cb->SendTextUpdatedEventIfAllowed(); else