Bug 23235 - SearchBar SearchButtonPressed event would fire when clicking Cancel button in iOS
Summary: SearchBar SearchButtonPressed event would fire when clicking Cancel button in...
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.2.3
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2014-09-22 06:41 UTC by haoxian
Modified: 2014-09-23 04:13 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description haoxian 2014-09-22 06:41:32 UTC
You can reproduce this issue by following code:

var searchbar = new SearchBar() { Placeholder="search some thing"};
searchbar.SearchButtonPressed += (sender, ent) =>
   DisplayAlert("result", "nothing", "OK");

It works in Android, but in iOS, the Cancel Button clicked in SearchBar would fire the SearchButtonPressed event.
Comment 1 Seth Rosetter 2014-09-22 13:54:37 UTC
I have confirmed this. Thanks!
Comment 2 Jason Smith [MSFT] 2014-09-23 04:13:50 UTC
Fixed in next release