-
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
Conversation
| "changes": [ | ||
| { | ||
| "packageName": "office-ui-fabric-react", | ||
| "comment": "Remove usage of Number.isNaN from SpinButton.tsx since it doesn't exist in IE11", |
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
| 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 } |
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.
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 isNaN function all the time.
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.
@cliffkoh, this is the only usage of Number.isNaN that I could find in fabric, everywhere else uses isNaN
* master: Applying package updates. ComboBox: Add any event as additional parameter to onChanged callback for saving pending changes (microsoft#4594) Remove usage of Number.NaN (microsoft#4615) Update createRef to match the new React 16.3 api (microsoft#4598) Update Breadcrumb.base.tsx Fix minor typos (microsoft#4607) Remove unused variables and enable no-unused-variable (microsoft#4608) Add optional overflowIndex prop to Breadcrumb (microsoft#4609) Applying package updates. Reenable bundlesize in yaml (microsoft#4590) Fix more index imports (microsoft#4604)
* master: DetailsRow: Flexshrink fix (microsoft#4622) [TextField] Implemented masking (microsoft#3783) Applying package updates. ComboBox: Add any event as additional parameter to onChanged callback for saving pending changes (microsoft#4594) Remove usage of Number.NaN (microsoft#4615)
Pull request checklist
$ npm run changeDescription of changes
SpinButton.tsx is not compatible with IE11 due to the usage of Number.isNaN, which is not supported in IE: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN
In this case isNaN should be sufficient for our needs, so updating the code to use that.