Skip to content

prevent scroll top from confirm jquery / prevent scroll top from remove product from mini cart in magento 2

In Magento 2, I’ve seen that when we click on the button remove a product from the mini cart, we will be scrolled to the top of the site.

enter image description here

I’ve see that this one is because of <a href="#"> tag, and replace with <a href="javascript:;">.

enter image description here

But that isn’t enough, it still has the problem, so I’ve debugged it deeper and found that this confirm from jquery have responsibility for this.

I just need to remove that confirm code, and it won’t scroll top anymore.

enter image description here

But unlucky that I can’t find any solution to prevent the scroll to top from the confirm jquery library.

Can someone help me please? Thanks.