File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
packages/kit-headless/src/components/collapsible Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -10,10 +10,11 @@ import {
10
10
type QRL ,
11
11
useTask$ ,
12
12
} from '@builder.io/qwik' ;
13
+
13
14
import { collapsibleContextId } from './collapsible-context-id' ;
14
15
import { type CollapsibleContext } from './collapsible-context.type' ;
15
16
import { isBrowser } from '@builder.io/qwik/build' ;
16
- import { getHiddenHeight } from '../../utils/get-hidden-height ' ;
17
+ import { useCollapsible } from './use-collapsible ' ;
17
18
18
19
export type CollapsibleProps = PropsOf < 'div' > & {
19
20
id ?: string ;
@@ -51,6 +52,8 @@ export const HCollapsible = component$((props: CollapsibleProps) => {
51
52
52
53
const contentHeightSig = useSignal < number | null > ( null ) ;
53
54
55
+ const { getHiddenHeight } = useCollapsible ( ) ;
56
+
54
57
const localId = useId ( ) ;
55
58
const itemId = id ?? localId ;
56
59
@@ -72,7 +75,7 @@ export const HCollapsible = component$((props: CollapsibleProps) => {
72
75
}
73
76
74
77
if ( contentHeightSig . value === null ) {
75
- contentHeightSig . value = getHiddenHeight ( contentRef . value ) ;
78
+ contentHeightSig . value = await getHiddenHeight ( contentRef . value ) ;
76
79
}
77
80
78
81
if ( contentHeightSig . value !== 0 ) {
Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ export function useCollapsible() {
16
16
17
17
el . after ( clone ) ;
18
18
const height = clone . offsetHeight ;
19
- console . log ( 'height' , height ) ;
20
19
21
20
clone . remove ( ) ;
22
21
You can’t perform that action at this time.
0 commit comments