New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue with borders around indeterminate progress bars. #6

Open
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@zoltan-dulac

zoltan-dulac commented Jan 3, 2012

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 Hawryluk added some commits Jan 3, 2012

Zoltan Hawryluk
A fix to a *small* bug that appears when a border is applied to the p…
…rogress 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. Fixed by changing offsetWidth to clientWidth.
@LeaVerou

This comment has been minimized.

Show comment
Hide comment
@LeaVerou

LeaVerou Feb 16, 2012

Owner

Wow, sorry for the delay!

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

Owner

LeaVerou commented Feb 16, 2012

Wow, sorry for the delay!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment