html - keep search input at the top of list view in ionic framework -


i new ionic framework, experimenting now. on 1 of page, have search input followed list, looks this:

enter image description here

when scroll up, search field scrolling list view. possible keep search field fixed @ top whilst scrolling?

this html markup far:

<ion-view view-title="force">   <ion-content>     <label class="item item-input">       <i class="icon ion-search placeholder-icon"></i>       <input type="text" placeholder="search force" data-ng-model="searchforce">     </label>     <div class="list">       <ion-item class="item-icon-right" ng-repeat="force in forces | filter:searchforce" type="item-text-wrap" href="#/tab/force/{{force.id}}">         {{force.name}}         <i class="icon ion-chevron-right icon-accessory"></i>       </ion-item>     </div>   </ion-content> </ion-view> 

you can use sub-header this:

 <ion-header-bar class="bar-light bar-subheader">       <input type="text" placeholder="search force" data-ng-model="searchforce">       <button ng-if="searchforce.length"               class="button button-icon ion-android-close input-button"               ng-click="clearsearch()">       </button> </ion-header-bar> 

codepen demo

also see post alternatives: http://forum.ionicframework.com/t/how-to-make-search-bar-sticky/20721


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -