Skip to content

Commit

Permalink
Merge pull request #12962 from bouaik/Scroll-to-top-when-using-pagina…
Browse files Browse the repository at this point in the history
…tion

Scroll to top when using pagination
  • Loading branch information
filipefurtad0 authored Nov 22, 2024
2 parents 3ec8cd2 + 8709c13 commit 0f4ca50
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/webpacker/controllers/search_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export default class extends Controller {
}

changePage(event) {
const productsForm = document.querySelector("#products-form");
productsForm.scrollIntoView({ behavior: "smooth" });
this.page.value = event.target.dataset.page;
this.submitSearch();
this.page.value = 1;
Expand Down

0 comments on commit 0f4ca50

Please sign in to comment.