Hi everyone - i’m a newbie app developer… Ionic is my first attempt, and it’s going well… nice job! I’m trying to write for Android and IOS.
My problem… I have search input box at the top, with a submit button:
<button type="submit" class="button button-clear" ui-sref="wherever">
<i class="icon ion-search" ></i>
</button>
<label class="item-input-wrapper">
<i class="icon ion-search placeholder-icon"></i>
<input type="search" placeholder="Search" ng-model="query" ng-change="something()" />
</label>
This works perfectly:
- user taps into the input field, soft keyboard appears with search button icon (in android, anyway… not tested ios)
- user types query which is shown in input field as expected
- user clicks on search icon on soft keyboard to cancel it
- user clicks on search button defined in my html above
- ui-sref goes to the correct state
is it possible to hook into the search icon button press on the soft keyboard, ie. get rid of step 4 completely. Seems ugly needing one tap to exit the soft keyboard, then another to hunt down the search button and do the submit.
I’m not sure if this is even an ionic question, or possibly a cordova question… I have not installed any cordova keyboard plug-ins as yet. I’m not clear how installing the ionic cordova keyboard plug will help, as it seems to be just about showing/hiding/disabling scroll, and not dealing with events eg. Search button press triggered from it ?
I’ve google around, and I have only found low-level javascript solutions that hook into push button events… not sure if this the recommended ionic/angular way… if someone could just steer me in the right general direction… would really appreciate it.