AdvancedCustomFields / AdvancedCustomFields/acf
Wysiwyg editor in meta box below block editor breaks on some occasions
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 945
- Forks
- 197
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
When I use the WYSIWYG editor field in a meta box that sits below the WordPress block editor, sometimes it appears also if there is no text. And if you look at the JavaScript console, it shows the volgende error message when I try to switch between the 'Visual' and 'Text' tabs:
Uncaught TypeError: Cannot read properties of null (reading 'setBaseAndExtent')
at i (tinymce.min.js?ver=49110-20250317:2:291936)
at Object.each (tinymce.min.js?ver=49110-20250317:2:1346)
at Object.select (tinymce.min.js?ver=49110-20250317:2:293163)
at _ (editor.min.js?ver=7.1:2:5063)
at n (editor.min.js?ver=7.1:2:1731)
at HTMLDocument.<anonymous> (editor.min.js?ver=7.1:2:248)
at C (tinymce.min.js?ver=49110-20250317:2:10800)
at HTMLDocument.d (tinymce.min.js?ver=49110-20250317:2:10946)
To Reproduce
Steps to reproduce the behavior:
Create a WYSIWYG field and add it to a metabox that sits below a block editor. Add some text to it, save it, and switch between text and visual modes. Reload the page. The text will be gone (sometimes, not always - that makes this bug tricky to reproduce).
Expected behavior
The text in the editor field should appear at all times.
Version Information:
- WordPress Version: 7.1
- PHP Version: 8.2.33
- ACF Version: Pro 6.8.9
- Browser: Chrome 152.0.7977.76
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
Reproduce this in WordPress with an ACF WYSIWYG field in a metabox below the block editor, then inspect the browser console while switching between Visual and Text modes. Done means the saved text remains visible after reload and switching modes no longer produces the reported TinyMCE selection error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, php, wordpress
- Domain
- content, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100