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

Fixed issue with borders around indeterminate progress bars.

Open zoltan-dulac opened this issue 13 years ago • 1 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.

NOTE that I didn't change progress-polyfill.min.js, since I wasn't sure what you used to minify it (I used Google Closure, and it was very different, so I thought I'd ask first).

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 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 22:01 zoltan-dulac

Wow, sorry for the delay!

Why removed minified version? It would be a nice addition.

LeaVerou avatar Feb 16 '12 23:02 LeaVerou