HTML5-Progress-polyfill icon indicating copy to clipboard operation
HTML5-Progress-polyfill copied to clipboard

Small Issue with borders in progress in polyfilled browsers

Open zoltan-dulac opened this issue 14 years ago • 2 comments

A small bug appears when a border is applied to the progress bar. If the value of the progress bar is set to zero, the progress bar increases in width slightly, until the value is changed to a non-zero value. You can see what I mean here:

http://www.useragentman.com/tmp/progressPolyfill/test1.html

In order to fix this issue, I changed line 161 in your script from:

if(progress.position !== -1) { progress.style.paddingRight = progress.offsetWidth * (1-progress.position) + 'px'; }

to this:

if(progress.position !== -1) { progress.style.paddingRight = progress.clientWidth * (1-progress.position) + 'px'; }

(Note the change from offsetWidth to clientWidth). When this is applied, the jump in width doesn't happen anymore, as seen here:

http://www.useragentman.com/tmp/progressPolyfill/test1-fixed.html

zoltan-dulac avatar Jan 03 '12 07:01 zoltan-dulac

Hi there,

Thanks for your contribution! Can you please send a pull request? It's the standard practice for any open source project here.

Happy new year!

LeaVerou avatar Jan 03 '12 10:01 LeaVerou

Oops. Sorry about that. Did that. Let me know what you think. :)

zoltan-dulac avatar Jan 04 '12 00:01 zoltan-dulac