Dawn Theme - Page jumps down when selecting product variant

Hi!

I’m having trouble with my product page. When i choose other variant of the product, page jumps down and header section hides.

1 Like

Would you mind to share your URL website? with password if its protected. Thanks!

https://hoodeer.shop/

1 Like

Hi @webizito

Th default Dawn them does not get the affect like that. I guess that come from 3rd party swatches app that you are using.

document.addEventListener('DOMContentLoaded', function () {
  var selectElements = document.querySelectorAll('select');
  if (selectElements) {
    selectElements.forEach(function (select) {
      select.addEventListener('change', function () {
        var header = document.querySelector('.header-wrapper');
        var scrollPosition = window.pageYOffset;
        var rect = header.getBoundingClientRect();
        window.scrollTo(0, scrollPosition + rect.top);
      });
    });
  }
});

Please try this script.

Thanks.

Where should i put that script?

In your JS file