This requirement is provided by the product. At the beginning, it was just set up <input style="padding-top: 3px;" type="search" placeholder="Search doctor or hospital" ng-model="query">
type="search"
I found that I couldn't get search on Android, which was so angry that I got the conclusion after searching on Google. I needed to apply a form form outside. So I added it to the event submitted by the form form and directly called the button button click event ng-click="searchSelect()". There is no need to listen to the search keyboard click event, which saves a lot of trouble. It is indeed very practical. I am really a genius.
The html code is as follows:
<form><div style="height: 50px;"><label id="search-input"><i style="position: relative;color: gray;font-size: 1.5em;top: 1px;"></i><input style="padding-top: 3px;" type="search" placeholder="Search or hospital" ng-model="query"></label><button style="color: #49B746;" ng-click="searchSelect()">Search</button></div></form>
The js code is as follows:
$scope.searchSelect = function(){if ($scope.currentSearchType == 'hospital'){}else{$scope.search();}};The above is what the editor introduced to you using JS to easily implement the ionic keyboard search function (super practical) and hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to everyone in time. Thank you very much for your support to Wulin.com website!