Skip to content

Commit

Permalink
fix: try to fix infinite width recalculation
Browse files Browse the repository at this point in the history
  • Loading branch information
Grsmto committed Apr 12, 2019
1 parent 842948d commit 24f205d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/simplebar/src/simplebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,11 +422,6 @@ export default class SimpleBar {
} ${this.elStyles.paddingBottom} ${this.elStyles.paddingLeft}`;
this.contentEl.style.height = isHeightAuto ? 'auto' : '100%';

this.placeholderEl.style.width = isWidthAuto
? `${this.resizeWrapperEl.clientWidth}px`
: 'auto';
this.placeholderEl.style.height = `${this.resizeWrapperEl.clientHeight}px`;

this.wrapperEl.style.margin = `-${this.elStyles.paddingTop} -${
this.elStyles.paddingRight
} -${this.elStyles.paddingBottom} -${this.elStyles.paddingLeft}`;
Expand Down Expand Up @@ -471,6 +466,13 @@ export default class SimpleBar {
this.toggleTrackVisibility('y');

this.hideNativeScrollbar();

// Determine placeholder size
this.placeholderEl.style.width = isWidthAuto
? `${this.resizeWrapperEl.clientWidth}px`
: 'auto';

this.placeholderEl.style.height = `${this.resizeWrapperEl.clientHeight}px`;
}

/**
Expand Down

0 comments on commit 24f205d

Please sign in to comment.