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.mjs CHANGED
@@ -8692,6 +8692,18 @@ var FoldableComponent = forwardRef18(function Foldable({
8692
8692
  clearTimeout(timeout);
8693
8693
  };
8694
8694
  }, [isOpen]);
8695
+ useEffect13(() => {
8696
+ if (!isOpen) return;
8697
+ if (!bodyRef.current) return;
8698
+ const observer = new ResizeObserver(() => {
8699
+ if (!bodyRef.current) return;
8700
+ setBodyVirtualHeight(bodyRef.current.scrollHeight * 2);
8701
+ });
8702
+ observer.observe(bodyRef.current);
8703
+ return () => {
8704
+ observer.disconnect();
8705
+ };
8706
+ }, [isOpen]);
8695
8707
  useImperativeHandle5(
8696
8708
  ref,
8697
8709
  () => {