Skip to content

Commit

Permalink
13002: fix the search-controller error
Browse files Browse the repository at this point in the history
- productForm is not accessible on the orders page
- putting the check to do the scrollIntoView only if the productForm is available
  • Loading branch information
chahmedejaz committed Nov 27, 2024
1 parent a493d70 commit 711f37b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/webpacker/controllers/search_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export default class extends Controller {

changePage(event) {
const productsForm = document.querySelector("#products-form");
productsForm.scrollIntoView({ behavior: "smooth" });
if (productsForm) productsForm.scrollIntoView({ behavior: "smooth" });

this.page.value = event.target.dataset.page;
this.submitSearch();
this.page.value = 1;
Expand Down

0 comments on commit 711f37b

Please sign in to comment.