Skip to content

Commit d500e94

Browse files
committed
Position: Use absolute positioning when getting scrollbar width to avoid reflows of user content. Fixes #9291 - Position - $.position.scrollbarWidth detection causes layout issues.
1 parent 0da5f99 commit d500e94

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ui/jquery.ui.position.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ $.position = {
7070
return cachedScrollbarWidth;
7171
}
7272
var w1, w2,
73-
div = $( "<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>" ),
73+
div = $( "<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>" ),
7474
innerDiv = div.children()[0];
7575

7676
$( "body" ).append( div );

0 commit comments

Comments
 (0)