Skip to content

WYSIWYG fields in ACF Blocks don't save without switching to Preview first #999

@DrZivil

Description

@DrZivil

Description

WYSIWYG fields inside ACF Blocks (particularly when nested in repeaters or groups) silently lose their content when saving the post. The content is only persisted if the user manually switches the block to "Preview" mode before saving.

Steps to Reproduce

  1. Create an ACF Block with a repeater field containing a WYSIWYG sub-field
  2. Add the block to a post in the Gutenberg editor
  3. Add a repeater row and type content into the WYSIWYG field
  4. Click "Save" (without switching the block to Preview first)
  5. Reload the page — the WYSIWYG content is gone

Expected Behavior

WYSIWYG field content should be saved regardless of whether the block is in Edit or Preview mode.

Actual Behavior

Content typed into WYSIWYG fields is lost on save unless the block is switched to Preview mode first. Other field types (text, select, etc.) save correctly.

Root Cause

In acf-pro-blocks.js, the BlockForm.componentDidAppend() method binds change detection to the block wrapper:

// ACF source (deobfuscated):
i.on("change keyup", () => {
    clearTimeout(a);
    a = setTimeout(s, 300);  // s() calls acf.serialize() → setAttributes({ data })
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions