Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
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

"type": "patch"
}
],
"packageName": "office-ui-fabric-react",
"email": "[email protected]"
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
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

aria-valuetext={ isNaN(Number(value)) ? value : undefined }
aria-valuemin={ min }
aria-valuemax={ max }
onBlur={ this._onBlur }
Expand Down