I made a few attempts, but I was not successful ... The priority is to be in pure JavaScript ... But as I could not, I tried with jQuery as well.
The situation would be, each time the user increases or decreases the amount in the input, the page refreshes and the Scroll should keep its last position. In my case he's going to the top.
Some of my attempts were:
//1)
var posicaoScroll = $(document).scrollTop();
$(document).scrollTop(posicaoScroll);
//2) "cart-table__product" é a classe a minha lista de produtos no carrinho
$(document).ready(function() {
$('.cart-table__product').attr({scrollTop: $('.cart-table__product').attr('scrollHeight')});
});
//3)
function scroll() {
var objScrDiv = document.getElementsByClassName("cart-table__product");
objScrDiv.scrollTop = objScrDiv.scrollHeight;
}