@homebound/beam 2.210.1 → 2.210.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -26,6 +26,16 @@ function Accordion(props) {
|
|
|
26
26
|
// When content is removed, simply set the height back to 0
|
|
27
27
|
setContentHeight(expanded && contentRef.current ? `${contentRef.current.scrollHeight}px` : "0");
|
|
28
28
|
}, [expanded]);
|
|
29
|
+
// Using a resizing observer to check if the content of the accordion changes (i.e. lazy loaded image, auto-sizing textarea, etc..),
|
|
30
|
+
// If it does change, then we need to update the container's height accordingly. Only update the height if the accordion is expanded.
|
|
31
|
+
// Note - This may result in two `setContentHeight` calls when the accordion opens: (1) via the above `useEffect` and (2) in `onResize`
|
|
32
|
+
// Both `setContentHeight` calls _should_ set the same value, so no unnecessary re-renders would be triggered, making this a harmless additional set call.
|
|
33
|
+
const onResize = (0, react_1.useCallback)(() => {
|
|
34
|
+
if (contentRef.current && expanded) {
|
|
35
|
+
setContentHeight(`${contentRef.current.scrollHeight}px`);
|
|
36
|
+
}
|
|
37
|
+
}, [expanded, setContentHeight]);
|
|
38
|
+
(0, utils_1.useResizeObserver)({ ref: contentRef, onResize });
|
|
29
39
|
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, testIds.container, { css: {
|
|
30
40
|
...Css_1.Css.bGray300.if(topBorder).bt.if(bottomBorder).bb.$,
|
|
31
41
|
...(size ? Css_1.Css.wPx(accordionSizes[size]).$ : {}),
|
|
@@ -160,7 +160,7 @@ function DateFieldBase(props) {
|
|
|
160
160
|
} }, void 0)) }, void 0));
|
|
161
161
|
const calendarButton = ((0, jsx_runtime_1.jsx)("button", Object.assign({ ref: buttonRef }, buttonProps, { disabled: isDisabled, css: Css_1.Css.if(isDisabled).cursorNotAllowed.$, tabIndex: -1 }, tid.calendarButton, { children: (0, jsx_runtime_1.jsx)(components_1.Icon, { icon: "calendar", color: isDisabled ? Css_1.Palette.Gray400 : Css_1.Palette.Gray700 }, void 0) }), void 0));
|
|
162
162
|
const EndFieldButtons = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isRangeFilterField && clearButton, !hideCalendarIcon && calendarButton] }, void 0));
|
|
163
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(TextFieldBase_1.TextFieldBase, Object.assign({}, textFieldProps, { errorMsg: errorMsg, helperText: helperText, required: required, labelProps: labelProps, inputProps: { ...
|
|
163
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(TextFieldBase_1.TextFieldBase, Object.assign({}, textFieldProps, { errorMsg: errorMsg, helperText: helperText, required: required, labelProps: labelProps, inputProps: { ...inputProps, size: inputSize }, inputRef: inputRef, inputWrapRef: inputWrapRef, inlineLabel: inlineLabel, onChange: (v) => {
|
|
164
164
|
// hide the calendar if the user is manually entering the date
|
|
165
165
|
state.close();
|
|
166
166
|
if (v) {
|