cancel
Showing results for 
Search instead for 
Did you mean: 

How to show searchbar on mobile

SOLVED

How to show searchbar on mobile

Hello,

I'am using a theme inheriting from luma theme and I already displayed the search bar on mobile by modifying the less file. But the click on the search icon doesn't fire the search function. I think that there is a javascript which display or hide the search when the icon is clicked, how can I disable or delete this please ?

 

Regards,

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to show searchbar on mobile

Hi @Yohannento 

Search functionality come from form-mini.js.

vendor/magento/module-search/view/frontend/web/js/form-mini.js

Please check with under generated folder also, js is generated or not after run commands.

pub/static/frontend/Magento/luma/en_US/Magento_Search/js/form-mini.js

Below funciton used for show and hide search option within js. Please try to check with this function also.

this.searchLabel.on('click', function (e) {
                console.log("testing bhanu");
                
            }.bind(this));

It will help you to check issue.



 

Problem solved? Click Accept as Solution!

View solution in original post

3 REPLIES 3

Re: How to show searchbar on mobile

Hi @Yohannento 

Search functionality come from form-mini.js.

vendor/magento/module-search/view/frontend/web/js/form-mini.js

Please check with under generated folder also, js is generated or not after run commands.

pub/static/frontend/Magento/luma/en_US/Magento_Search/js/form-mini.js

Below funciton used for show and hide search option within js. Please try to check with this function also.

this.searchLabel.on('click', function (e) {
                console.log("testing bhanu");
                
            }.bind(this));

It will help you to check issue.



 

Problem solved? Click Accept as Solution!

Re: How to show searchbar on mobile

Hi @Bhanu Periwal 

 

Many thanks, for your help, I disabled the functionnality in the JS file. 

 

Regards,

Re: How to show searchbar on mobile

Hi @Yohannento  can you please share the changes in this form-mini.js