I’m using the Dawn theme for my website and need help troubleshooting an issue with the search bar. When searching for a term (e.g., ‘denim’) and then scrolling through the results, the background also scrolls. I’d like the search results to be sticky, so the background doesn’t scroll.
Specifically, when scrolling down or up, the user experiences a glitch. Can someone assist me in resolving this issue?
website: https://the-rugged.com/
password: rugged
Thanks in advance.
Hi @Sivadarshan
I see it’s sticky now, how do you want other?
Hi @Sivadarshan ,
Use the below codes in the open and close method of predictive-search.js :-
Inside open() method (LOCK SCROLL) use this code :
open()
{
this.classList.add(‘predictive-search–open’);
document.body.style.overflow = ‘hidden’;
document.body.style.height = ‘100vh’;
}
Inside close() method (UNLOCK SCROLL) use this code :
close()
{
this.classList.remove(‘predictive-search–open’);
document.body.style.overflow = ‘’;
document.body.style.height = ‘’;
}
Please let me know if this works for you .
Thanks!
@BiDeal-Discount In background the products are scrolling all the way, I don’t want that things to be scrolled
I think I got your point, Let try to add this custom css :
body.overflow-hidden {
overflow: hidden !important;
}
To get this done, you will need to modify the theme code, if you are an expert in that, it will be easily done
Hi @Sivadarshan ,
When there are more options available in denim, the background does not scroll. However, when searching for other products like tees, shirts, and others, it seems to work fine.
Please let us know how you would like it to function.
Thank you!