AdvancedCustomFields / AdvancedCustomFields/acf
WYSIWYG fields in ACF Blocks don't save without switching to Preview first
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 945
- Forks
- 197
- PR merge metrics
- No merged PRs in 30d
Description
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
- Create an ACF Block with a repeater field containing a WYSIWYG sub-field
- Add the block to a post in the Gutenberg editor
- Add a repeater row and type content into the WYSIWYG field
- Click "Save" (without switching the block to Preview first)
- 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 })
});
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect acf-pro-blocks.js, especially BlockForm.componentDidAppend() and its change/key-up handling. Reproduce the nested repeater WYSIWYG case in the Gutenberg editor, then verify that content persists when saving in Edit mode without switching to Preview.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100