Skip to content

Commit

Permalink
Fixed resizeObserver issue when you are on loans tab on new profile p…
Browse files Browse the repository at this point in the history
…age. (#329)

Fixed resizeObserver issue when you are on loans tab on new profile page.
  • Loading branch information
nsharma123 authored Dec 14, 2023
1 parent 157d2ba commit b1556fa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/sort-filter-bar/sort-filter-bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ export class SortFilterBar
private disconnectResizeObserver(
resizeObserver: SharedResizeObserverInterface
) {
// return if element not defined
if (!this.sortSelectorContainer || !this.desktopSortContainer) return;

resizeObserver.removeObserver({
target: this.sortSelectorContainer,
handler: this,
Expand All @@ -229,6 +232,10 @@ export class SortFilterBar

private setupResizeObserver() {
if (!this.resizeObserver) return;

// return if element not defined
if (!this.sortSelectorContainer || !this.desktopSortContainer) return;

this.resizeObserver.addObserver({
target: this.sortSelectorContainer,
handler: this,
Expand Down

0 comments on commit b1556fa

Please sign in to comment.