Skip to content

Commit

Permalink
Once products start loading, scroll higher, ie. just above filters
Browse files Browse the repository at this point in the history
can see the loading spinner then
  • Loading branch information
jibees committed Aug 18, 2023
1 parent 5395bc5 commit 2abfa62
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/webpacker/controllers/products_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default class extends ApplicationController {

beforeReflex() {
this.showLoading();
this.scrollToElement();
}

afterReflex() {
Expand All @@ -29,6 +30,10 @@ export default class extends ApplicationController {
}
};

scrollToElement = () => {
this.element.scrollIntoView();
};

getLoadingController = () => {
return (this.loadingController ||= this.application.getControllerForElementAndIdentifier(
this.loadingTarget,
Expand Down

0 comments on commit 2abfa62

Please sign in to comment.