I tested in Firefox using OSx with Retina Display. The nanoscroller adds a big value of padding-right to the element container.
Reading the code I figured out the following:
When this condition is true: BROWSER_SCROLLBAR_WIDTH === 0 && isFFWithBuggyScrollbar(), you're adding a padding-right 14 to the computed padding-right.
I think that there is an issue getting the computed style. You are trying to remove the "px" characters from the computed with a replace:
.replace(/\D+/g, '')
That's fine when the computed padding is "20px", but it would be "20.50px", then with your replace the computed value will be "2050", a wrong value.
I think the "replace" would be: .replace(/[^0-9.]/g, '')
I tested in Firefox using OSx with Retina Display. The nanoscroller adds a big value of padding-right to the element container.
Reading the code I figured out the following: When this condition is true: BROWSER_SCROLLBAR_WIDTH === 0 && isFFWithBuggyScrollbar(), you're adding a padding-right 14 to the computed padding-right. I think that there is an issue getting the computed style. You are trying to remove the "px" characters from the computed with a replace: .replace(/\D+/g, '') That's fine when the computed padding is "20px", but it would be "20.50px", then with your replace the computed value will be "2050", a wrong value. I think the "replace" would be: .replace(/[^0-9.]/g, '')