Skip to content

Conversation

@christiango
Copy link
Member

Pull request checklist

  • Addresses an existing issue: Fixes #0000
  • Include a change request file using $ npm run change

Description 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.

"changes": [
{
"packageName": "office-ui-fabric-react",
"comment": "Remove usage of Number.isNaN from SpinButton.tsx since it doesn't exist in IE11",
Copy link
Contributor

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 }
Copy link
Contributor

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.

Copy link
Contributor

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

@dzearing dzearing merged commit c86fc5b into microsoft:master Apr 19, 2018
Markionium added a commit to Markionium/office-ui-fabric-react that referenced this pull request Apr 19, 2018
* 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)
Markionium added a commit to Markionium/office-ui-fabric-react that referenced this pull request Apr 20, 2018
* 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)
@microsoft microsoft locked as resolved and limited conversation to collaborators Aug 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants