Problem/Motivation

Same issue as #3489038: Mercury tray resizes when modal dialogs are opened, but I think we are seeing the problem now when the sidebar opens a modal dialog.

Steps to reproduce

  • Add node using mercury editor with an entity reference field that uses an entity browser
  • Attempt to open the entity browser via the sidebar
  • Confirm the sidebar is now full screen. (see below)

Proposed resolution

Fix JS

Remaining tasks

TBD

User interface changes

N/A

API changes

N/A

Data model changes

N/A

CommentFileSizeAuthor
#2 ezgif-3-40b4f61e55.gif403.01 KBjrockowitz
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jrockowitz created an issue. See original summary.

jrockowitz’s picture

Issue summary: View changes
StatusFileSize
new403.01 KB
jrockowitz’s picture

Priority: Normal » Critical

Marking this critical because the mercury editor remains locked in the full-width mode even after reloading the page.

sethhill made their first commit to this issue’s fork.

sethhill’s picture

Status: Active » Needs work

Dialogs should be behaving quite a bit better now.

I also moved some of the handlers around on resizing the sidebar tray, so that should better detect when the sidebar is open or closed. There is still one bug where if you collapse the sidebar and then start dragging it back open, it flies open to the width before it was collapsed. I thought it better to leave that as it stands currently and get more eyes on this sooner.

I believe this is undocumented at the moment, but you can configure dialog settings based on specific Paragraph types. This is found in Mercury Editor Dialog Settings. To do so, create a new object with the Paragraph's name appended with _form. For example:

_defaults:
  width: fit-content
  height: fit-content
  drupalAutoButtons: false
  dialogClass: lpb-dialog
  resizable: true
entity_ref_form:
  width: 600
  height: fit-content
  drupalAutoButtons: false
  dialogClass: lpb-entity-reference
  resizable: true
formatted_text_form:
  width: 800
  height: 600

sethhill’s picture

Status: Needs work » Needs review

I made some modifications to improve the experience of resizing the sidebar tray.

When collapsing and re-opening the tray using the button in the toolbar, the tray will now open at the default width. This makes the default width setting more relevant, because it's now possible to restore the tray to that default.

Resolved the issue where the tray popped open unexpectedly to a previously-stored value.

I think this is ready to merge if it looks good to others.

jrockowitz’s picture

Status: Needs review » Reviewed & tested by the community

I tested the MR, and it fixes the reported issue.

  • sethhill committed aa067eff on 2.2.x
    Issue #3489991 by sethhill, jrockowitz: Mercury tray resizes when entity...
sethhill’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.