react-better-html 1.1.139 → 1.1.140

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.
package/dist/index.js CHANGED
@@ -8768,6 +8768,18 @@ var FoldableComponent = (0, import_react28.forwardRef)(function Foldable({
8768
8768
  clearTimeout(timeout);
8769
8769
  };
8770
8770
  }, [isOpen]);
8771
+ (0, import_react28.useEffect)(() => {
8772
+ if (!isOpen) return;
8773
+ if (!bodyRef.current) return;
8774
+ const observer = new ResizeObserver(() => {
8775
+ if (!bodyRef.current) return;
8776
+ setBodyVirtualHeight(bodyRef.current.scrollHeight * 2);
8777
+ });
8778
+ observer.observe(bodyRef.current);
8779
+ return () => {
8780
+ observer.disconnect();
8781
+ };
8782
+ }, [isOpen]);
8771
8783
  (0, import_react28.useImperativeHandle)(
8772
8784
  ref,
8773
8785
  () => {