-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Remove usage of Number.NaN #4615
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "changes": [ | ||
| { | ||
| "packageName": "office-ui-fabric-react", | ||
| "comment": "Remove usage of Number.isNaN from SpinButton.tsx since it doesn't exist in IE11", | ||
| "type": "patch" | ||
| } | ||
| ], | ||
| "packageName": "office-ui-fabric-react", | ||
| "email": "[email protected]" | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -202,8 +202,8 @@ export class SpinButton extends BaseComponent<ISpinButtonProps, ISpinButtonState | |
| type='text' | ||
| role='spinbutton' | ||
| aria-labelledby={ label && this._labelId } | ||
| aria-valuenow={ !Number.isNaN(Number(value)) ? Number(value) : undefined } | ||
| aria-valuetext={ Number.isNaN(Number(value)) ? value : undefined } | ||
| aria-valuenow={ !isNaN(Number(value)) ? Number(value) : undefined } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be more robust to check if Number.isNaN is a defined function and if so, to use it rather than rely on the less reliable, global
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @cliffkoh, this is the only usage of Number.isNaN that I could find in fabric, everywhere else uses isNaN |
||
| aria-valuetext={ isNaN(Number(value)) ? value : undefined } | ||
| aria-valuemin={ min } | ||
| aria-valuemax={ max } | ||
| onBlur={ this._onBlur } | ||
|
|
||
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.
SpinButton: Handle the case where Number.isNaN is not supported in IE 11