Sticky header problem

35 4 2


I was using this tutorial:

the sticky header is working fine.

I run into another problem though: when I click the menu or the search icon I get pushed back to the top of the page

I went into theme.js and disabled the code  "window.scrollTo(0, 0);" by adding //window.scrollTo(0, 0);

now when I click the menu it is working fine and letting me stay at the page, but when I click the search icon I just see this on desktop and mobile:

I think the search bar is showing at the top of the page where I cant see it.

I also tried to remove the search icon by adding this code to the header.liquid

    display: none !important;

but it makes the sticky header not work anymore. 

Is there anyway to fix this?


Thanks alot