diff --git a/packages/simplebar/src/simplebar.js b/packages/simplebar/src/simplebar.js index 98fdfdad..a5b05fb6 100755 --- a/packages/simplebar/src/simplebar.js +++ b/packages/simplebar/src/simplebar.js @@ -64,6 +64,14 @@ export default class SimpleBar { SimpleBar.getRtlHelpers = memoize(SimpleBar.getRtlHelpers); + const elWindow = getElementWindow(this.el); + const elOverflowY = elWindow.getComputedStyle(this.el).overflowY; + const parentDisplay = elWindow.getComputedStyle(this.el.parentElement).display; + if ((elOverflowY == 'auto' || elOverflowY == 'scroll') + && (parentDisplay == 'flex' || parentDisplay == 'inline-flex')) { + // Prevent bug where Simplebar is shown along with the native scrollbar. + this.el.style.height = '100%'; + } this.init(); }