- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2018
06:50 AM
07-31-2018
06:50 AM
How to stop form-mini.js from loading on pages?
I have a fully custom search done by myself, so I want to get rid of form-mini.js since its causing issues with my own version of search.
The problem is, I cant seem to override it, or remove it via <remove>.
Any ideas?
Labels:
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2018
07:36 AM
07-31-2018
07:36 AM
Re: How to stop form-mini.js from loading on pages?
Hello @blaz_p
magento 2 intilize js using data-mage-init
if you see quick search input type
<input id="search"
data-mage-init='{"quickSearch":{
"formSelector":"#search_mini_form",
"url":"http://magento2-demo.nexcess.net/search/ajax/suggest/",
"destinationSelector":"#search_autocomplete"}
}'
using
data-mage-init
it is calling
var config = { map: { '*': { quickSearch: 'Magento_Search/form-mini' } } };
based on requirejs-config.js
so you need to remove
data-mage-init='{"quickSearch":{ "formSelector":"#search_mini_form", "url":"http://magento2-demo.nexcess.net/search/ajax/suggest/", "destinationSelector":"#search_autocomplete"} }'
Hope it will help you.
if work then mark as solution.
Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer