File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
packages/vue-collapsed/src Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ import type { Ref } from 'vue'
4
4
5
5
type RefEl = Ref < HTMLElement | null >
6
6
7
+ const isFirefox = ( ) => typeof navigator !== 'undefined' && navigator . userAgent . includes ( 'Firefox' )
8
+
7
9
export function getComputedHeight ( el : RefEl ) {
8
10
if ( ! el . value ) return 0
9
11
return parseFloat ( getComputedStyle ( el . value ) . height )
@@ -20,8 +22,14 @@ export function getTransitionProp(el: RefEl) {
20
22
21
23
const { transition } = getComputedStyle ( el . value )
22
24
23
- // If transition is not defined, return the default one
24
- if ( transition === 'all 0s ease 0s' ) return { transition : DEFAULT_TRANSITION }
25
+ // If transition is not defined via CSS, return the default one referencing the auto duration
26
+ if (
27
+ transition === 'all 0s ease 0s' ||
28
+ ( isFirefox ( ) &&
29
+ transition ===
30
+ 'all' ) /* Since Firefox v124, Gecko returns transition 'all' instead of 'all 0s ease 0s' */
31
+ )
32
+ return { transition : DEFAULT_TRANSITION }
25
33
26
34
return { transition }
27
35
}
You can’t perform that action at this time.
0 commit comments