Skip to content

Commit

Permalink
Merge pull request #389 from statikbe/KarelJanVanHaute/issue374
Browse files Browse the repository at this point in the history
Add pagination back and forward fix to the filter component.
  • Loading branch information
arnaud-dbu authored Oct 15, 2024
2 parents da3ce63 + c0d2500 commit 6be4c13
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tailoff/js/components/filter.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,14 @@ export class FilterComponent {
},
false
);

window.addEventListener('popstate', (event) => {
this.showLoading();
this.getFilterData(window.location.href, false, false);
});
}

private getFilterData(url, clearPage = false) {
private getFilterData(url, clearPage = false, pushState = true) {
if (this.getFilterTimeout) {
clearTimeout(this.getFilterTimeout);
}
Expand Down Expand Up @@ -295,7 +300,9 @@ export class FilterComponent {

_self.ariaLiveElement.innerHTML = responseElement.querySelector('.js-filter-aria-live').innerHTML;

history.pushState('', 'New URL: ' + url, url);
if (pushState) {
history.pushState('', 'New URL: ' + url, url);
}

_self.scrollToStart();

Expand Down

0 comments on commit 6be4c13

Please sign in to comment.