File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -211,15 +211,21 @@ class Sidenav {
211211 const { x } = this . _element . getBoundingClientRect ( ) ;
212212
213213 if (
214- ( this . options . sidenavRight && ! isRTL ) ||
215- ( ! this . options . sidenavRight && isRTL )
214+ ( this . options . sidenavRight && ! isRTL ( ) ) ||
215+ ( ! this . options . sidenavRight && isRTL ( ) )
216216 ) {
217217 let scrollBarWidth = 0 ;
218218 // check if there is scrollbar and account for it width if there is one
219- if ( this . container . scrollHeight >= this . container . clientHeight ) {
219+ if ( this . container . scrollHeight > this . container . clientHeight ) {
220220 scrollBarWidth =
221221 this . container . offsetWidth - this . container . clientWidth ;
222222 }
223+
224+ if ( this . container . tagName === "BODY" ) {
225+ const documentWidth = document . documentElement . clientWidth ;
226+ scrollBarWidth = Math . abs ( window . innerWidth - documentWidth ) ;
227+ }
228+
223229 return Math . abs ( x + scrollBarWidth - containerEnd ) > 10 ;
224230 }
225231
You can’t perform that action at this time.
0 commit comments