Add a cancel event and/or command to the MAUI SearchBar control #20995
Unanswered
vsfeedback
asked this question in
Ideas
Replies: 1 comment
-
this is an excellent idea. I need to handle the "clear" searchbar text event when pressed. Maybe I can check when the searchbar text is empty by binding to TextChanged and trap the event that way or if this wont work create my own button that clear the searchbar text and then does other stuff i want. Yes, binding to "TextChanged" event of Searhbar captures the clear button press action. So I can then know when a user cancels the search. Something like if (string.IsNullOrEmpty(SearchQuery)) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This issue has been moved from a ticket on Developer Community.
The .NET MAUI SearchBar control (as of the release of Microsoft.Maui.Controls 8.0.0-rc2.9373) has no event or command associated with the cancel button, and neither the SearchCommand command nor the SearchButtonPressed event is invoked when the cancel button is tapped or the cancel (x) is tapped. This makes it impossible to know when a user cancels the search, effectively making the control nearly useless unless you perform "live" searching as the user types text into the control.
Original Comments
Feedback Bot on 10/15/2023, 09:53 PM:
(private comment, text removed)
Beta Was this translation helpful? Give feedback.
All reactions