@brizy/ui
Version:
React elements in Brizy style
14 lines (13 loc) • 523 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getHeightStyle = void 0;
const constants_1 = require("../constants");
const getHeightStyle = (isOpen, isMeasured, elementRef) => {
if (isOpen && isMeasured && (elementRef === null || elementRef === void 0 ? void 0 : elementRef.current)) {
return {
[`--${constants_1.BRZ_PREFIX}-collapsible-open`]: elementRef.current.scrollHeight + "px",
};
}
return {};
};
exports.getHeightStyle = getHeightStyle;