Skip to main content

Search and Top Navigation

#8785 closed feature (fixed)

Opened November 07, 2012 02:11PM UTC

Closed November 08, 2012 08:32PM UTC

Progressbar: Remove _value() and always sanitize value option

Reported by: scottgonzalez Owned by: k_borchers
Priority: minor Milestone: git
Component: ui.progressbar Version: git (not yet released)
Keywords: Cc:
Blocked by: Blocking:
Description

There's no reason for the value option to ever be invalid. We should force it to a valid value on init and whenever max, or value changes. The validation on change needs to occur in _setOptions() so that we properly handle a call like .progressbar( "option", { value 120, max: 150 } ) which would try to set the value above the current max.

Attachments (0)
Change History (5)

Changed November 07, 2012 02:12PM UTC by scottgonzalez comment:1

milestone: 1.10.0git
status: newopen

Changed November 08, 2012 04:41AM UTC by k_borchers comment:2

owner: → k_borchers
status: openassigned

I started working on this but noticed a number of things that confuse me and before I create more tickets I am hoping to get some other input.

1 - The min is not configurable. It is 0 and can not be updated. I don't think that is right.

2 - ARIA min/max are not updated if the option is changed

3 - There is no API doc for the max (and missing min) option

Changed November 08, 2012 01:47PM UTC by scottgonzalez comment:3

1) The lack of a min option is by design. When do you ever have negative progress?

2) That's a bug.

3) It's surprising that it's missing on the planning wiki too. I'll update the wiki and the API docs.

Changed November 08, 2012 02:19PM UTC by scottgonzalez comment:4

description: There's no reason for the `value` option to ever be invalid. We should force it to a valid value on init and whenever `min`, `max`, or `value` changes. The validation on change needs to occur in `_setOptions()` so that we properly handle a call like `.progressbar( "option", { value -6, min: -10 } )` which would try to set the value below the current min.There's no reason for the `value` option to ever be invalid. We should force it to a valid value on init and whenever `max`, or `value` changes. The validation on change needs to occur in `_setOptions()` so that we properly handle a call like `.progressbar( "option", { value 120, max: 150 } )` which would try to set the value above the current max.

Changed November 08, 2012 08:32PM UTC by Kris Borchers comment:5

resolution: → fixed
status: assignedclosed

Progressbar: Refactor to better handle option changes and sanitize values. Fixes #8785 - Progressbar: Remove _value() and always sanitize value option

Changeset: 8976bc7e3d1f03254f914297b1be1b730690d2b8