Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
Created attachment 19857 [details]
If there is no text entered into the SearchBar and the user presses the search button (enter), nothing happens. The SearchCommand is not executed, nor is the SearchButtonPressed event raised.
This is a problem because if the user searches for "foo", and then clears their search to go back to "all results", the SearchCommand cannot be executed and the view model must resort to hacks to make this work.
Repro is attached.
The reproduction provided only includes an iOS implementation. Are you expecting this behavior to be across all platforms? By default on iOS, the Search button is not enabled if there is no text in the field, so this sort of behavior would be expected. I'm setting this to NEEDINFO for now as an elaboration of expectations is required, which I hope you understand.
Yes, my expectation is consistency across platforms. I only included iOS to keep the download smaller and more focussed.
If the platform behavior is to be upheld, is there an alternative to the hack I mentioned?
Setting status back to new as I believe I answered your questions.
For the time being I'll set this to confirmed, although something like this will need to be discussed with the team before we move further. We typically aim to keep behavior in line with what the platform does by default; there are exceptions to this, but is unfortunately no guarantee that anything will be changed from the current behavior.
Based on what you described, what I would perhaps suggest for now is hooking into TextChanged and if the Text value returns to an empty state to call whatever method you'd use to reset the search, although it's possible you're already doing something similar to this.
Yes, that is exactly what I'm doing. The problem of course is that the user experience is inconsistent. On the one hand, searching for "foo" requires that they instigate the search. On the other, clearing the text will automatically search. This is jarring if they've entered some text erroneously, and want to delete it to start again.
Kent, on a device the user has no "enter" key to hit; the user hits "search" on the onscreen keyboard to search and that "search" button is grayed out if there is no text in the search box which is typical per iOS UX. Do you suggest we offer an option to enable that button on iOS when there is no text in the search field? I'm not sure that feature would fly simply because most iOS users are accustomed to seeing a default search if there is not text in the field and even that the search populates as they type. But if you'd like to make that request please post it to the forums as the behavior now is expected as far as I can tell.