Skip to content

Commit 747500d

Browse files
committed
Fix #31 - Update default transition value since Chromium 128
1 parent 209e47d commit 747500d

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ dist
66
/cypress/screenshots/
77
.vscode/*
88
!.vscode/extensions.json
9+
.idea
910
*.tgz

packages/vue-collapsed/src/utils.ts

+3-8
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import type { Ref } from 'vue'
44

55
type RefEl = Ref<HTMLElement | null>
66

7-
const isFirefox = () => typeof navigator !== 'undefined' && navigator.userAgent.includes('Firefox')
8-
97
export function getComputedHeight(el: RefEl) {
108
if (!el.value) return 0
119
return parseFloat(getComputedStyle(el.value).height)
@@ -17,13 +15,10 @@ export function getTransitionProp(el: RefEl) {
1715
const { transition } = getComputedStyle(el.value)
1816

1917
// If transition is not defined via CSS, return the default one referencing the auto duration
20-
if (
21-
transition === 'all 0s ease 0s' ||
22-
(isFirefox() &&
23-
transition ===
24-
'all') /* Since Firefox v124, Gecko returns transition 'all' instead of 'all 0s ease 0s' */
25-
)
18+
if (transition === 'all 0s ease 0s' || transition === 'all') {
19+
/* Since Firefox v124 and Chromium v128, their rendering engine transition computes 'all' instead of 'all 0s ease 0s' */
2620
return { transition: DEFAULT_TRANSITION }
21+
}
2722

2823
return { transition }
2924
}

0 commit comments

Comments
 (0)