Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 230550

Ion-search: keep cancel button visible

$
0
0

My solution was to bind a function to the ionInput event, adding a custom class name…

  menuFocusMode(ev){
    let el=document.getElementsByTagName('ion-searchbar');
    el[0].classList.add('MY-CUSTOM-CLASS')
  }

… then update the scss file for my page template…

  .searchbar-ios.searchbar-show-cancel.MY-CUSTOM-CLASS .searchbar-ios-cancel {
    display: block;
    padding-left:8px;
  }

This is useful for my needs, since my search results bring up a custom UI, meaning the input field loses focus as soon as the user starts interacting with buttons (which normally causes the CANCEL button to disappear). Hope this helps someone else.


Viewing all articles
Browse latest Browse all 230550

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>