mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-05 02:41:33 +00:00
13002: fix the search-controller error
- productForm is not accessible on the orders page - putting the check to do the scrollIntoView only if the productForm is available
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user