Skip to content

Commit 1c03796

Browse files
committed
Add Number.isNaN back just in case
Appears to have been added in #8831
1 parent 2648542 commit 1c03796

File tree

1 file changed

+8
-3
lines changed
  • packages/mui-material/src/Tabs

1 file changed

+8
-3
lines changed

packages/mui-material/src/Tabs/Tabs.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,9 +420,14 @@ const Tabs = React.forwardRef(function Tabs(inProps, ref) {
420420
[size]: tabMeta ? tabMeta[size] : 0,
421421
};
422422

423-
// IE11 support, replace with Number.isNaN
424-
// eslint-disable-next-line no-restricted-globals
425-
if (isNaN(indicatorStyle[startIndicator]) || isNaN(indicatorStyle[size])) {
423+
if (
424+
!(
425+
typeof indicatorStyle[startIndicator] === 'number' &&
426+
!Number.isNaN(indicatorStyle[startIndicator]) &&
427+
typeof indicatorStyle[size] === 'number' &&
428+
!Number.isNaN(indicatorStyle[size])
429+
)
430+
) {
426431
setIndicatorStyle(newIndicatorStyle);
427432
} else {
428433
const dStart = Math.abs(indicatorStyle[startIndicator] - newIndicatorStyle[startIndicator]);

0 commit comments

Comments
 (0)