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'
44
55type RefEl = Ref < HTMLElement | null >
66
7+ const isFirefox = ( ) => typeof navigator !== 'undefined' && navigator . userAgent . includes ( 'Firefox' )
8+
79export function getComputedHeight ( el : RefEl ) {
810 if ( ! el . value ) return 0
911 return parseFloat ( getComputedStyle ( el . value ) . height )
@@ -20,8 +22,14 @@ export function getTransitionProp(el: RefEl) {
2022
2123 const { transition } = getComputedStyle ( el . value )
2224
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 }
2533
2634 return { transition }
2735}
You can’t perform that action at this time.
0 commit comments