UNPKG

@brizy/ui

Version:
10 lines (9 loc) 365 B
import { BRZ_PREFIX } from "../constants"; export const getHeightStyle = (isOpen, isMeasured, elementRef) => { if (isOpen && isMeasured && (elementRef === null || elementRef === void 0 ? void 0 : elementRef.current)) { return { [`--${BRZ_PREFIX}-collapsible-open`]: elementRef.current.scrollHeight + "px", }; } return {}; };