# How to remove showFilter button when no results on mobile view

**URL:** <https://discuss.elastic.co/t/how-to-remove-showfilter-button-when-no-results-on-mobile-view/285395>\
**Category:** Elastic Search\
**Created:** [September 28, 2021, 5:17pm UTC](https://discuss.elastic.co/t/how-to-remove-showfilter-button-when-no-results-on-mobile-view/285395 "2021-09-28T17:17:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pradeepjanga](https://avatars.discourse-cdn.com/v4/letter/p/9e8a1a/32.png) [@pradeepjanga](https://discuss.elastic.co/u/pradeepjanga)\
**Post date:** [September 28, 2021, 5:17pm UTC](https://discuss.elastic.co/t/how-to-remove-showfilter-button-when-no-results-on-mobile-view/285395/1 "2021-09-28T17:17:32Z")

</div>

Hi,

when our App in Desktop mode, i dont see showfilter until results are populated. But on mobile view i can see a button with "showFilters" when there is no results populated. how to hide or remove until results are available.

Mobile view:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/2/c280c8de79d939e06821217fdbd669f20c775b72.png)

Desktop view:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/7/979cf5feeb663d6043de58980c283cdd5141aa13.png)

Thanks

---

<div class="post-metadata">

**Author:** ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)\
**Post date:** [September 30, 2021, 11:39am UTC](https://discuss.elastic.co/t/how-to-remove-showfilter-button-when-no-results-on-mobile-view/285395/2 "2021-09-30T11:39:02Z")

</div>

Unfortunately there's no built in way to hide that when there are no results.

If you can, submit an issue to the search-ui repository [GitHub - elastic/search-ui: Search UI. Libraries for the fast development of modern, engaging search experiences.](https://github.com/elastic/search-ui), we could add a new check to hide that when a search has not be performed yet.

In the meantime, you could use the [wasSearched](https://github.com/elastic/search-ui/blob/master/ADVANCED.md#application-state) state to conditionally add a CSS class that hides that button.

You could also enable the [alwaysSearchOnInitialLoad](https://github.com/elastic/search-ui/blob/master/ADVANCED.md#advanced-configuration) flag so that you never get into this state.

---

<div class="post-metadata">

**Author:** ![pradeepjanga](https://avatars.discourse-cdn.com/v4/letter/p/9e8a1a/32.png) [@pradeepjanga](https://discuss.elastic.co/u/pradeepjanga)\
**Post date:** [September 30, 2021, 8:16pm UTC](https://discuss.elastic.co/t/how-to-remove-showfilter-button-when-no-results-on-mobile-view/285395/3 "2021-09-30T20:16:25Z")

</div>

Hey, Thanks for the workaround.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 4, 2022, 8:32am UTC](https://discuss.elastic.co/t/how-to-remove-showfilter-button-when-no-results-on-mobile-view/285395/4 "2022-11-04T08:32:32Z")

</div>


