Closing dialogs can cause content in editor to horizontally scroll

Created on 16 December 2024, 7 days ago

Problem/Motivation

When closing a dialog after editing a layout, the content in my editor is scrolling horizontally, as shown in this GIF:

Steps to reproduce

This may not be reproducible in other themes. My front-end theme is a Bootstrap5 β†’ subtheme. It's happening consistently for me every time I edit a layout. It doesn't happen if I edit a component-type paragraph.

Proposed resolution

I've traced this back to this section of code in post-messages-listener.js:

onCloseMercuryDialog: function () {
        document.querySelectorAll('.is-me-focused').forEach((el) => {
          el.focus();
          el.classList.remove('is-me-focused');
        });
      }

If it's changed to the follow, the scrolling behavior doesn't happen.

onCloseMercuryDialog: function () {
        document.querySelectorAll('.is-me-focused').forEach((el) => {
          el.focus({preventScroll: true});
          el.classList.remove('is-me-focused');
        });
      }

Remaining tasks

MR coming

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Active

Version

2.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States zengenuity

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024