There is an index page template:
<ion-nav-bar type="bar bar-header bar-default">
<ion-nav-back-button class="button-icon ion-ios7-arrow-thin-left">
</ion-nav-back-button>
</ion-nav-bar>
<ion-nav-view></ion-nav-view>
And there is a view header template
<header class="bar bar-header item-input-inset">
<form class="item-input-wrapper search-bar">
<i class="icon ion-ios7-search placeholder-icon"></i>
<input type="search" placeholder="Search" ng-model="search.query" style="width:100%!important;">
<i class="clear-search icon ion-ios7-close-empty" ng-click="clear()"></i>
</form>
<button class="button button-clear" ng-click="close()" ng-show="hasFocus || search.query.length">Cancel</button>
<span class="ng-transclude">
<!-- right side header buttons go here -->
</span>
<a class="button button-clear" style="display:none;"></a><!-- !!! dummy placeholder for button:last-child -->
</header>
The problem is that when user clicks on back nav arrow on a view WITHOUT the search bar control, and a view is switched back to view that CONTAINS the search bar, a virtual keyboard appears in emulator and on a real iOS device. Like index (with search) -> details (without search) -> back to index…
At the same time, a bunch of tap event handling methods are triggered, and reported with a web inspector.
When user clicks at the very-very left side of the arrow, click coordinates do not match
<i class="icon ion-ios7-search placeholder-icon"></i>
and the keyboard does not appear.
SbSearchBarDirective
does nothing to raise a keyboard for sure.
Thus, there are two issues: tap/click event is passed to a previous view (with timeout or directly, I’m not sure), and tap/click on the lens icon fires a virtual keyboard.
Please let me know how to avoid unwilling rising of a keyboard either by preventing passing tap/click to a previous view, or by deactivating tap/click on the icon. I can disable it by adding <i .. onclick="return false;">
, but it looks weird for me. And of course it does not remove the problem origin.
PS Even tapping/clicking on a header around the search control rises a keyboard, but the input itself remains not focused. This confuses users.