@dmitryvim/form-builder 0.3.1 → 0.3.2

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.
@@ -37,6 +37,21 @@ export declare function ensureThemingHooks(doc: Document): void;
37
37
  * makes the total box (border + padding + content) equal scrollHeight, which
38
38
  * leaves the content area short by `2 * border-width` — at compact density
39
39
  * (8px padding, 21px line-height) that's enough to clip a single line.
40
+ *
41
+ * Deferred-layout recovery (v0.3.2):
42
+ * A `ResizeObserver` re-runs `resize()` whenever the textarea's content-box
43
+ * WIDTH changes. Two host patterns the one-shot `setTimeout(0)` below can't
44
+ * survive on its own:
45
+ * 1. Form mounted inside a still-hidden / 0-width container (e.g. inactive
46
+ * tab, collapsed accordion, modal that isn't open yet). At setTimeout
47
+ * firing time `scrollHeight === 0` → height collapses to ~borderY (~2px).
48
+ * Once the host reveals the container, width transitions 0 → real and we
49
+ * re-measure.
50
+ * 2. Responsive width changes (host resizes the column). Wrapped content
51
+ * re-flows so the textarea grows/shrinks to fit.
52
+ * Loop guard: `resize()` only writes the HEIGHT, so we ignore observer fires
53
+ * where width hasn't moved — otherwise our own height writes would feed back
54
+ * into the observer.
40
55
  */
41
56
  export declare function applyAutoExpand(textarea: HTMLTextAreaElement): void;
42
57
  /**
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.3.1",
6
+ "version": "0.3.2",
7
7
  "description": "A reusable JSON schema form builder library",
8
8
  "main": "./dist/cjs/index.cjs",
9
9
  "module": "./dist/esm/index.js",