I have a small issue with InstantSearch JS as I have custom code and decided to change the regular search widget to a Custom Search widget based on Algolia documentation.
I need to implement custom code that wasn't possible with a regular search widget - I couldn't access search functions to add the code I need.
The problem is that I'm also using custom code where add hidden attribute data-search-term which helps display initial results based on this term. But with the default search widget value of this term been all the time hidden, not visible within the input field but when I switched to the custom search widget value of this attribute is visible and each time when I type into input fields, it duplicates its content.
Des someone have the solution to this problem? How can I hide the value of this attribute from the input field so it will stay within DOM but will be hidden from the input for users?
<div id="searchbox" data-feed="widget" data-category="Test" data-search-term="Demo"></div>
Above is HTML, it has data-search-term. It passes this one into the input field that is generated by InstantSearch JS.
As a result of that data-search-term is visible within input. How can I hide it?