AdvancedCustomFields / AdvancedCustomFields/acf

Text cursor jumps to ACF WYSIWYG field upon hitting enter key

Open
#946 15 comments 2 reactions 0 assignees View on GitHub

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 editing a page with Gutenberg that contains ACF blocks with a WYSIWYG field the cursor jumps to the last WYSIWYG field on the page.

To Reproduce
Steps to reproduce the behavior:

  1. Edit or create a page
  2. Add an ACF Block that contains a WYSIWYG field with default settings
  3. Switch ACF Block to Edit view
  4. Now click the title or a Gutenberg paragraph and hit the Enter key
  5. Cursor jumps to the last ACF WYSIWYG field on the page (that is in Edit mode)

Expected behavior
The text cursor should just create a new paragraph instead of jumping to the ACF WYSIWYG field.

Screenshots or Video
https://github.com/user-attachments/assets/6e8ff233-3d42-4d74-835d-b702d169165d

Version Information:

  • WordPress Version: 6.7.1
  • PHP Version: 7.4
  • ACF Version: ACF PRO 6.3.12
  • Browser: Chrome

Additional context
I already did some digging. I think it has something to do with TinyMCE because when I enable Delay Initialization (TinyMCE will not be initialized until field is clicked) the cursor doesn't jump to the WYSIWYG field.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in a Gutenberg page containing an ACF block with a WYSIWYG field, following the listed steps. Compare the cursor behavior with TinyMCE Delay Initialization enabled and disabled. Done means pressing Enter in the title or a Gutenberg paragraph creates a new paragraph without moving focus to the last WYSIWYG field.

Written by the indexing model from the issue text.

Assessment

Tech stack
wordpress
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.