Problem/Motivation

The buttons are not inline with each other.This issue was brought up in this issue.

Steps to reproduce

Steps to get the leave preview box:
1) Go to edit node
2) Click on Preview button at the bottom.
3) Click on logo or website title on Navbar.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3359012

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

Utkarsh_33 created an issue. See original summary.

utkarsh_33’s picture

StatusFileSize
new121.96 KB

PFA the screenshot with the css changes applied.

utkarsh_33’s picture

Status: Active » Needs review
santosh_verma’s picture

working on this

smustgrave’s picture

Status: Needs review » Needs work

So if claro is enabled as the default theme the preview page doesn't function at all.

If olivero is then the buttons are aligned fine.

So not seeing this issue, think it could use additional steps.

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

santosh_verma’s picture

@smustgrave, Yes If we set the Claro theme as the default, it appears to be causing an issue as described. However, when using the Olivero theme, everything seems to be working fine.

Tested Drupal Version: 10.1.x-dev
The steps to reproduce is the same as mention above
1) Go to edit node
2) Click on Preview button at the bottom.
3) Click on logo or website title on Navbar.

I reviewed the Mr #3959,
patch applied successfully and solved the issue

before
before

after
after

but there a little more space to improve the code like
1. we can write more logical and nested css for block

 .ui-dialog-buttonpane .ui-dialog-buttonset {
+  display: flex;
+  float: none;
+  gap: 0.7rem;
   justify-content: flex-end;
-  margin: 0 var(--space-s);
+  margin-top: 10px;
+  margin-right: 10px;
+  margin-bottom: 10px;
+  padding-inline-end: 5px;
 }
and
+.ui-dialog .ui-dialog-buttonpane button {
+  margin: 0;
+}

2. we can remove float: none as there is no use of this.

utkarsh_33’s picture

Status: Needs work » Needs review
StatusFileSize
new613.2 KB
new594.55 KB

I think the approach proposed by @Ben seems to be more efficient than it's counter CSS workaround implemented in 3359012-claro-modal-dialog.It recalculates the width of the ui-dialog box based on the combined width of the buttons and then assign the width to the ui-dialog box so that the buttons fit inline with each other.I have attached the screenshots for further refferences.

utkarsh_33’s picture

Status: Needs review » Reviewed & tested by the community

Closing the other MR and Marking it as RTBC as everything seems to work as intended.I have also attached the screen shots for the same in #11.

lauriii’s picture

Status: Reviewed & tested by the community » Needs work

Added comment on the MR.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

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

hooroomoo’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

Confirmed the bug is fixed still.

Think it's good to get these things fixed but can't imagine people using claro for previewing. The preview page has many issues in claro.

bnjmnm’s picture

Status: Reviewed & tested by the community » Needs work

I'm not sure about 42 additional lines of code for what @smustgrave points out in #18 is a pretty unlikely edge case. This may be the result of something I was trying out in an MR earlier but I think I may have been overcomplicating it. There have been scenarios where the dialog width calculation is confused by the moving of the submit buttons, but it doesn't seem to be a problem here.

I did a quick test of adding a single additional line of CSS and it seemed to work, but perhaps I missed something earlier in the thread eliminated that as a solution? Or maybe I just poisoned the well with convoluted JS?

.ui-dialog-buttonpane .ui-dialog-buttonset {
  display: flex; /* Was this already tried and ruled out? */
  justify-content: flex-end;
  margin: 0 var(--space-s);
}
hooroomoo’s picture

Status: Needs work » Needs review
StatusFileSize
new42.65 KB
new42.65 KB

Removed the JS, and added display: flex.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Verified the bug is still fixed doing same tests as before.

lauriii’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs work
StatusFileSize
new45.19 KB

Removing the margin creates a regression to some other dialog forms:

hooroomoo’s picture

Only adding display: flex causes the Leave preview text on the button to break into two lines. I applied the CSS from comment #9 and it looks good on the preview and other modal dialogs i looked at.

hooroomoo’s picture

Status: Needs work » Needs review
preeti.chawla’s picture

@Utkarsh_33 I applied the CSS from comment #9 and it working or looks fine on the preview and other modal dialogs. We can move to RTBC
please refer Screenshot

preeti.chawla’s picture

StatusFileSize
new89.65 KB
new107.87 KB
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Tested the view dialog mentioned in #22 and don't see any regression

  • lauriii committed aa42e237 on 11.x
    Issue #3359012 by hooroomoo, lauriii, Utkarsh_33, bnjmnm, smustgrave:...

lauriii’s picture

Status: Reviewed & tested by the community » Fixed

Committed aa42e23 and pushed to 11.x. Thanks!

Status: Fixed » Closed (fixed)

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