Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Progress + Bar not respecting the Max value set on Progress #3618

Closed
zediah opened this issue May 5, 2015 · 3 comments
Closed

Progress + Bar not respecting the Max value set on Progress #3618

zediah opened this issue May 5, 2015 · 3 comments

Comments

@zediah
Copy link

zediah commented May 5, 2015

I've got a max value set on 'progress' element (with many 'bar' elements beneath it) and the value is never making it's way into the actual controller for the entire progress bar. This means that the max will always be the default value of 100 for a 'progress' element and incorrectly calculate the width.

I believe this is due to a recent change in ProgressController where it is attempting to default $scope.max if not set by doing $scope.max = $scope.max || default. In the previous version of the code it would look in $attrs for max instead ($scope.max = $attrs.max || default). The reason the new version does not work is because for the 'progress' directive (but not the ProgressBar directive), there is no 'max' variable defined in the scope, thus $scope.max will never be set for this directive. It used to work before because it was looking in $attrs.

Example: http://plnkr.co/edit/K2Y3G39IvP8VJbgwl06D?p=preview
If you inspect the progress bar, you can see that it's taking up 100% width even though it's value is set to 186 out of 211 (211 being the maximum set). There is also another bar beneath it that is invisible with the value of 25.

I believe to fix this while maintaining the current implementation, 'max: "=?"' should be added to the scope object of the 'progress' directive. Although I don't know the full ramifications of this and there certainly are other ways (such as reverting to $attrs again).

EDIT: trying to fix some terrible english.

@bdgamble
Copy link

bdgamble commented May 5, 2015

👍 I am seeing the same thing

@karianna karianna added this to the 0.13.x milestone May 5, 2015
@twwwt
Copy link

twwwt commented May 9, 2015

Ditto.
+1 to fix that.

@groupsky
Copy link
Contributor

7ccff02 broke this feature. Now the max attribute needs to be defined on the progress directive.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants