Hi @Tiagiinho
The changes you did working perfectly, but I have theme oriented change which you can follow if you want.
First go to header.liquid file and comment out the code as below at line number 674
if (this.predictiveSearch && this.predictiveSearch.isOpen) return;
/*
if (scrollTop > this.currentScrollTop && scrollTop > this.headerBounds.bottom) {
if (this.preventHide) return;
requestAnimationFrame(this.hide.bind(this));
} else if (scrollTop < this.currentScrollTop && scrollTop > this.headerBounds.bottom) {
if (!this.preventReveal) {
requestAnimationFrame(this.reveal.bind(this));
} else {
window.clearTimeout(this.isScrolling);
this.isScrolling = setTimeout(() => {
this.preventReveal = false;
}, 66);
requestAnimationFrame(this.hide.bind(this));
}
} else if (scrollTop <= this.headerBounds.top) {
requestAnimationFrame(this.reset.bind(this));
}
*/
Then, add below css in base.css at bottom
#shopify-section-header {
z-index: 20;
position: sticky;
top: 0;
}
This quick solution will work using theme existing code change with minimum effort and with some theme animation.
Thanks