Merge pull request #11417 from jibees/11410-go-back-to-top-after-selecting-a-page-in-pagination

🚧 BUU: Once products are loaded, scroll higher, ie. just above filters
This commit is contained in:
David Cook
2023-08-22 09:20:31 +10:00
committed by GitHub

View File

@@ -11,6 +11,7 @@ export default class extends ApplicationController {
beforeReflex() {
this.showLoading();
this.scrollToElement();
}
afterReflex() {
@@ -29,6 +30,10 @@ export default class extends ApplicationController {
}
};
scrollToElement = () => {
this.element.scrollIntoView();
};
getLoadingController = () => {
return (this.loadingController ||= this.application.getControllerForElementAndIdentifier(
this.loadingTarget,