From 7065e26fb3a6eb698e49e4aaf911b0656f466efd Mon Sep 17 00:00:00 2001 From: John Roberts Date: Sat, 18 Jul 2015 01:19:18 +0200 Subject: [PATCH] Fix handling of "Cancel" button in wxSearchCtrl under OS X. Pressing it results in a control action with an empty, but not null, string. Recognize it correctly. See #16869. --- src/osx/cocoa/srchctrl.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osx/cocoa/srchctrl.mm b/src/osx/cocoa/srchctrl.mm index 982151adfb..e1e5c585d8 100644 --- a/src/osx/cocoa/srchctrl.mm +++ b/src/osx/cocoa/srchctrl.mm @@ -155,7 +155,7 @@ public : if ( wxpeer ) { NSString *searchString = [m_searchField stringValue]; - if ( searchString == nil ) + if ( searchString == nil || !searchString.length ) { wxpeer->HandleSearchFieldCancelHit(); }