-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(progress-spinner): coerce string values #7791
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
Conversation
josephperrott
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall, a couple idea/questions.
| OnChanges { | ||
|
|
||
| private _value: number; | ||
| private readonly _baseSize = 100; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be a module const? Since it is only read during construction, and can't be modified?
| set value(newValue: number) { | ||
| if (newValue != null && this.mode === 'determinate') { | ||
| this._value = Math.max(0, Math.min(100, newValue)); | ||
| this._value = Math.max(0, Math.min(100, coerceNumberProperty(newValue))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We created a clamp method in MdProgressBar for this, should we do similar here? Potentially moving clamp to a util?
If so it might be in a follow up PR, but thought I would throw it out there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We used to have a clamp function because it was used in a couple of places, but now it's only used once so it should be fine having it inline.
|
@crisbeto Add |
6317583 to
5defc78
Compare
5defc78 to
24a8062
Compare
|
Needs rebase. |
24a8062 to
41c5a2d
Compare
|
Rebased. |
|
Needs rebase |
Coerces any string values that are passed to `value`, `diameter` and `strokeWidth` to numbers. Fixes angular#7790.
41c5a2d to
09b3afe
Compare
|
Rebased @josephperrott. |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Coerces any string values that are passed to
value,diameterandstrokeWidthto numbers.Fixes #7790.