mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-10 03:30:22 +00:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user