#15106 closed bug (fixed)
$.position.scrollbarWidth() always gets zero when system theme has very wide scrollbars on Firefox
Reported by: | Qi Fan | Owned by: | Scott González |
---|---|---|---|
Priority: | minor | Milestone: | 1.12.2 |
Component: | ui.position | Version: | 1.12.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Version: jquery-ui 1.12.1 Browser: Firefox 50. Not reproducible on IE or Chrome. OS: Windows 7. Xubuntu 16.04.1 LTS
Steps to reproduce: Windows 7:
- In Windows control panel, open "Appearance and Personalization" -> "Personalization" -> "Window Color". Select "Item" to "Scrollbar". Set size to 45.
- Open Firefox 50, load jquery and jquery-ui, access $.position.scrollbarWidth().
- You get 0.
Xubuntu 16.04.1 LTS:
Use windows 7 steps 2 and 3.
Live demo: https://jsfiddle.net/w1Lgfs7v/
Expected Behaviour: $.position.scrollbarWidth() should return correct scrollbar width.
position.scrollbarWidth gets the scrollbar width by creating a hidden 50px by 50px element and fill it with large content.
On Firefox, when the scrollbar width is large and the element is small, all scrollbars become hidden.
Usually 50x50 div is enough for most default OS themes, but the default xubuntu (xfce) 16.04 theme has just enough scrollbar width to hide scrollbars in a 50x50 div.
I changed the dimensions of the hidden element to 100x100 for my own project to at least get correct scrollbar width for users running Xubuntu default theme, but this may not help if someone using Windows sets system scrollbar width to 100.
Change History (4)
comment:1 Changed 6 years ago by
comment:2 Changed 6 years ago by
@Scott:
I tried your patch on Windows 7 with OS scrollbars set to 45px. The fix works.
Test jsfiddle used: https://jsfiddle.net/uc5nb08d/1/
And, I just found that Windows 7 can only set scrollbar width to a maximum of 100, so your choice of using 200px element is enough.
comment:3 Changed 6 years ago by
Owner: | set to Scott González |
---|---|
Resolution: | → fixed |
Status: | new → closed |
In efb1fee:
comment:4 Changed 6 years ago by
Milestone: | none → 1.12.2 |
---|
Can you test this patch? https://github.com/jquery/jquery-ui/pull/1811