Skip to main content

Search and Top Navigation

#15150 closed bug (notabug)

Opened March 15, 2017 06:05AM UTC

Closed March 16, 2017 07:16PM UTC

progressbar.value() doesn't work when passing non-integer value (like: float)

Reported by: regionbbs Owned by:
Priority: minor Milestone: none
Component: ui.progressbar Version: 1.12.0
Keywords: Cc:
Blocked by: Blocking:
Description

I use jQuery UI (v1.12.0) progressbar to display file upload progress, I calculated my progress with var percent = (offset/lenght).toFixed(), but when I pass value by using progressbar("value", percent);, progress bar can't display current percent.

My team member can re-produce this issue, and has found a workaround solution: percent = parseInt(percent) to force convert value to integer, then works.

Attachments (0)
Change History (3)

Changed March 15, 2017 06:14AM UTC by regionbbs comment:1

Reproduce test case: https://jsfiddle.net/xnwze5Lw/

Changed March 15, 2017 07:05AM UTC by rjollos comment:2

description: I use jQuery UI (v1.12.0) progressbar to display file upload progress, I calculated my progress with "var percent = (offset/lenght).toFixed()", but when I pass value by using progrssbar("value", percent); , progress bar can't display current percent. \ \ My team member can re-produce this issue, and has found a workaround solution: percent = parseInt(percent) to force convert value to integer, then works.I use jQuery UI (v1.12.0) progressbar to display file upload progress, I calculated my progress with `var percent = (offset/lenght).toFixed()`, but when I pass value by using `progressbar("value", percent);`, progress bar can't display current percent. \ \ My team member can re-produce this issue, and has found a workaround solution: `percent = parseInt(percent)` to force convert value to integer, then works.

Changed March 16, 2017 07:16PM UTC by scottgonzalez comment:3

resolution: → notabug
status: newclosed

You're not passing a float (there's no distinction between integer and float in JavaScript), you're passing a string, which isn't a valid value.