Support

Account

Home Forums Gutenberg Auto-Scroll Bug in Gutenberg (WP 6.7+) When Creating a New Paragraph

Helping

Auto-Scroll Bug in Gutenberg (WP 6.7+) When Creating a New Paragraph

  • If you have an ACF block with mode => edit and it contains a WYSIWYG Editor field in visual mode, positioned below a newly created paragraph, WordPress incorrectly detects the iframe in WYSIWYG Editor as the new paragraph and scrolls down to it.

    🚨 However, if the ACF block is above the new paragraph, the issue does not occur.

    ### ✅ Quick fix:
    Change all blocks from 'mode' => 'edit' to 'auto':

    acf_register_block_type([
        'mode' => 'auto',
    ]);

    📌 This will fix the issue, preventing WordPress from scrolling to the WYSIWYG Editor.

  • As it turned out, the fix for the problem is quite simple

    add_action('acf/input/admin_footer', function () {
      ?>
        <script>
          jQuery(document).off('tinymce-editor-init.keep-scroll-position');
        </script>
      <?php
    });
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.