Skip to content

Commit 3f66285

Browse files
committed
fix: revert fix for #430 since it's breaking flex environment
1 parent 0ca9cf6 commit 3f66285

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

packages/simplebar/src/simplebar.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -329,11 +329,9 @@ export default class SimpleBar {
329329
this.elStyles = elWindow.getComputedStyle(this.el);
330330
this.isRtl = this.elStyles.direction === 'rtl';
331331

332-
const contentElOffsetWidth = this.contentEl.offsetWidth;
333-
334332
const isHeightAuto = this.heightAutoObserverEl.offsetHeight <= 1;
335-
const isWidthAuto =
336-
this.heightAutoObserverEl.offsetWidth <= 1 || contentElOffsetWidth > 0;
333+
const isWidthAuto = this.heightAutoObserverEl.offsetWidth <= 1;
334+
const contentElOffsetWidth = this.contentEl.offsetWidth;
337335

338336
const contentWrapperElOffsetWidth = this.contentWrapperEl.offsetWidth;
339337

@@ -350,14 +348,13 @@ export default class SimpleBar {
350348

351349
// Determine placeholder size
352350
this.placeholderEl.style.width = isWidthAuto
353-
? `${contentElOffsetWidth || contentElScrollWidth}px`
351+
? `${contentElOffsetWidth}px`
354352
: 'auto';
355353
this.placeholderEl.style.height = `${contentElScrollHeight}px`;
356354

357355
const contentWrapperElOffsetHeight = this.contentWrapperEl.offsetHeight;
358356

359-
this.axis.x.isOverflowing =
360-
contentElOffsetWidth !== 0 && contentElScrollWidth > contentElOffsetWidth;
357+
this.axis.x.isOverflowing = contentElScrollWidth > contentElOffsetWidth;
361358
this.axis.y.isOverflowing =
362359
contentElScrollHeight > contentWrapperElOffsetHeight;
363360

0 commit comments

Comments
 (0)