Skip to content

Commit

Permalink
fix: handle NaN value
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaacmaamouche committed Aug 8, 2023
1 parent 6156823 commit b71b181
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/Tabs/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export const getParentScale = (element: HTMLElement | null): number => {
if (!element) return 1
const elementScale = window.getComputedStyle(element).scale
if (elementScale !== 'none') {
return Number(elementScale)
const elementScale = Number(window.getComputedStyle(element).scale)
if (!isNaN(elementScale)) {
return elementScale
} else {
return getParentScale(element.parentElement)
}
Expand Down

0 comments on commit b71b181

Please sign in to comment.