How do you detect the click on SearchBar search icon that opens the search textbox?

dg2k 1,386 Reputation points
2022-11-20T20:54:29.173+00:00

I couldn't find any associated event(s) that will enable me to detect when the search icon is tapped and textbox is opened to type in search keyword for the SearchBar control.

Is there a workaround for this?

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,844 questions
0 comments No comments
{count} votes

Accepted answer
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 35,021 Reputation points Microsoft Vendor
    2022-11-21T08:32:25.523+00:00

    Hello,

    There is no such an API to detect click event on search icon of SearchBar, even if on native Android or iOS platfroms.

    For instance on Android, access to the searchbar icon has been restricted, you need to find its id in Android to find it.

    If you want to implement this functionality, then using custom controls would be a better approach.

    You could refer to Create a custom control using handlers to get more details.

    Best Regards,

    Alec Liu.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful