Skip to content

[Bug] Form builder field wrappers grow infinitely (width feedback loop) on Craft 5 #2528

@Alice-zhan000

Description

@Alice-zhan000

What happened?

On Craft 5, opening any form in the Freeform form builder causes every field's
drag wrapper (div[draggable="true"] with the sc-gnWmTK styled-component
class) to receive a massive inline width value that keeps growing on every
reflow. The inner [data-field-type] element is fine — the bug is on the drag
wrapper above it.

Result: fields stretch tens of thousands of pixels horizontally. Selecting or
editing a field becomes impossible.

Expected Behaviour

Drag wrappers should match the row width (or be auto), as they did on
Craft 4.

Actual Behaviour

Drag wrappers get assigned an inline pixel width that grows on every reflow.

DOM Snippet

Trimmed DOM of a single row
<div class="sc-fWJabs bJeSsJ">
  <div class="sc-dkrmZR jxmDlE" style="transform: none;">
    <div class="sc-dBEzSj bfjFjk"
         style="opacity: 0; width: 37842.7px; transform: translate3d(0px, 0px, 0px) scale(0);">
    </div>
    <div class="sc-gnWmTK kkxAPD" draggable="true"
         style="width: 37846px; opacity: 1; transform: none;">
      <button></button>
      <button></button>
      <div data-field-type="text" class="sc-loChfy eBHEAE field"></div>
    </div>
  </div>
</div>

### Errors and Stack Trace (if available)

```shell

How can we reproduce this?

  1. Use Craft 5.10.x + Freeform 5.15.13.
  2. Edit any existing form (a mix of text, textarea, dropdown, email, cards fields, etc.).
  3. Open the form builder.
  4. Inspect any field's drag wrapper — it has an inline style="width: 18923px"` (or similar).
  5. Trigger a reflow (resize window, scroll, click) — the width value increases each time.
freeform5_field_expand_issue.webm

Freeform Edition

Pro

Freeform Version

5.15.13

Craft Version

5.10.2 (just upgraded from craft 4)

When did this issue start?

  • Unsure
  • Fresh install of Freeform
  • After upgrading from older Freeform version
  • After upgrading from older Craft version
  • After a change to hosting configuration

Previous Freeform Version

5.15.7

Metadata

Metadata

Assignees

Labels

investigatingCurrently investigating the report
No fields configured for Problem.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions