Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed "Collapsible: --radix-collapsible-content-height CSS variable m… #3270

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions packages/react/collapsible/src/Collapsible.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import * as React from 'react';
import { composeEventHandlers } from '@radix-ui/primitive';
import { useComposedRefs } from '@radix-ui/react-compose-refs';
import { createContextScope } from '@radix-ui/react-context';
import { useId } from '@radix-ui/react-id';
import { Presence } from '@radix-ui/react-presence';
import { Primitive } from '@radix-ui/react-primitive';
import { useControllableState } from '@radix-ui/react-use-controllable-state';
import { useLayoutEffect } from '@radix-ui/react-use-layout-effect';
import { useComposedRefs } from '@radix-ui/react-compose-refs';
import { Primitive } from '@radix-ui/react-primitive';
import { Presence } from '@radix-ui/react-presence';
import { useId } from '@radix-ui/react-id';
import * as React from 'react';

import type { Scope } from '@radix-ui/react-context';

Expand Down Expand Up @@ -211,8 +211,8 @@ const CollapsibleContentImpl = React.forwardRef<
{...contentProps}
ref={composedRefs}
style={{
[`--radix-collapsible-content-height` as any]: height ? `${height}px` : undefined,
[`--radix-collapsible-content-width` as any]: width ? `${width}px` : undefined,
[`--radix-collapsible-content-height` as any]: height ? `${height}px` : 0,
[`--radix-collapsible-content-width` as any]: width ? `${width}px` : 0,
...props.style,
}}
>
Expand All @@ -232,14 +232,14 @@ const Trigger = CollapsibleTrigger;
const Content = CollapsibleContent;

export {
createCollapsibleScope,
//
Collapsible,
CollapsibleTrigger,
CollapsibleContent,
CollapsibleTrigger,
Content,
createCollapsibleScope,
//
Root,
Trigger,
Content,
};
export type { CollapsibleProps, CollapsibleTriggerProps, CollapsibleContentProps };
export type { CollapsibleContentProps, CollapsibleProps, CollapsibleTriggerProps };