Once products start loading, scroll higher, ie. just above filters

can see the loading spinner then
This commit is contained in:
Jean-Baptiste Bellet
2023-08-16 15:18:01 +02:00
parent 5395bc56f8
commit 2abfa623f0

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,