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 {
1010 type QRL ,
1111 useTask$ ,
1212} from '@builder.io/qwik' ;
13+
1314import { collapsibleContextId } from './collapsible-context-id' ;
1415import { type CollapsibleContext } from './collapsible-context.type' ;
1516import { isBrowser } from '@builder.io/qwik/build' ;
16- import { getHiddenHeight } from '../../utils/get-hidden-height ' ;
17+ import { useCollapsible } from './use-collapsible ' ;
1718
1819export type CollapsibleProps = PropsOf < 'div' > & {
1920 id ?: string ;
@@ -51,6 +52,8 @@ export const HCollapsible = component$((props: CollapsibleProps) => {
5152
5253 const contentHeightSig = useSignal < number | null > ( null ) ;
5354
55+ const { getHiddenHeight } = useCollapsible ( ) ;
56+
5457 const localId = useId ( ) ;
5558 const itemId = id ?? localId ;
5659
@@ -72,7 +75,7 @@ export const HCollapsible = component$((props: CollapsibleProps) => {
7275 }
7376
7477 if ( contentHeightSig . value === null ) {
75- contentHeightSig . value = getHiddenHeight ( contentRef . value ) ;
78+ contentHeightSig . value = await getHiddenHeight ( contentRef . value ) ;
7679 }
7780
7881 if ( contentHeightSig . value !== 0 ) {
Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ export function useCollapsible() {
1616
1717 el . after ( clone ) ;
1818 const height = clone . offsetHeight ;
19- console . log ( 'height' , height ) ;
2019
2120 clone . remove ( ) ;
2221
You can’t perform that action at this time.
0 commit comments