Problem/Motivation

Submit button can fill the entire width of the the off canvas dialog box, which can be too wide in situations such as dialogs that appear in the top of the screen

Steps to reproduce

  1. Go to your Drupal site.
  2. Go to any page with an off canvas dialog with a submit button. ( For example in the module Layout Builder.)
  3. Observe the size of the button

Proposed resolution

Off-canvas Submit button width is based on it's content, not the current 100%.

Remaining tasks

User interface changes

The off-canvas submit button width is based on content, not 100% of its container

API changes

Data model changes

Release notes snippet

Issue fork drupal-3213995

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

Gauravmahlawat created an issue. See original summary.

gauravvvv’s picture

Status: Active » Needs review
StatusFileSize
new942 bytes

Patch attached for same, please review.

Status: Needs review » Needs work

The last submitted patch, 2: 3213995-2.patch, failed testing. View results

gauravvvv’s picture

Status: Needs work » Needs review

Random failure, moving to NR

cindytwilliams’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new54.4 KB
new24.81 KB

Patch #2 applies. The submit button in the top dialog box is now displaying as the correct size.

Desktop:

Mobile:

lauriii’s picture

Component: Olivero theme » settings_tray.module
Status: Reviewed & tested by the community » Needs work

This happens with all core themes meaning we should probably fix this in the off-canvas itself.

radheymkumar’s picture

StatusFileSize
new22.17 KB

@Gauravmahlawat I am not able to reproduce this issue will u suggest me about that how i can check this issue
I am checking in drupal-9.3.x-dev
sharing screenshot for after and before check

bnjmnm’s picture

Issue tags: +Needs issue summary update

Re #7 This is reproducable by using the tugboat link in the issue summary https://tugboat-aqrmztryfqsezpvnghut1cszck2wwasr.tugboat.qa/dialog and clicking "off canvas top dialog". That demo page happens to use password reset, but the issue reported is not specific to the password reset process, the concern is how the button appears in the dialog.

This could be made clearer in the issue summary

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

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

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

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.

quietone’s picture

Issue summary: View changes
Issue tags: +Bug Smash Initiative, +Novice

This is tagged for an issue summary update. For this issue that looks suitable for a novice, adding tag. For more information see Write an issue summary for an existing issue for guidance.

Aditi Saraf made their first commit to this issue’s fork.

_utsavsharma’s picture

StatusFileSize
new947 bytes
new947 bytes

Patch for 11.x.

anushrikumari’s picture

Issue summary: View changes
Status: Needs work » Needs review
Issue tags: +DrupalCon Lille 2023

We, the mentoring team, are triaging issues for first-time contributors at DrupalCon Lille and I think this is a good issue for the contribution day.
We are reserving this issue so please don't work on this issue if you are not at DrupalCon Lille. You can continue the work when the event is over.

mathiasbaetens’s picture

@kristofvercruyssen @simontrivali and me will be working on this issue at DrupalCon Lille with our mentors @anushrikumari and @shriaas

simontrivali’s picture

Patch seems to work perfectly!

mathiasbaetens’s picture

Title: Olivero: submit button is top dialog box is too wide » Olivero: submit button is too wide in the off canvas dialog box
Issue summary: View changes

Issue summary updated as of comment #19

mathiasbaetens’s picture

Status: Needs review » Reviewed & tested by the community

This patch seems to be working. Moving to RTBC.

bnjmnm’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/themes/olivero/css/components/button.pcss.css
@@ -106,6 +106,13 @@
+#drupal-off-canvas input[type="submit"] {
+  &.button {
+    float: left;
+    width: auto;
+  }
+}

Floats should only be added as a last resort - and that would likely only be in situations where floats are already in use nearby. Floats can lead to layout problems and accessibility bugs and CSS has added many new features to make floats unnecessary.

This should instead use a modern alternative such as flexbox for positioning.

gauravvvv’s picture

Updating attributions

nitin shrivastava’s picture

StatusFileSize
new981 bytes
new424 bytes

attribution updated.
trying to address #21

a_ramos’s picture

Status: Needs work » Needs review

I'm setting the status of this issue to "Needs review" as the patch is updated. It's my first contribution.

dishakatariya’s picture

StatusFileSize
new25.86 KB
new23.4 KB

Hi, I have verified this issue, and it looks fine to me.

Testing Steps
1. Go to your Drupal site.
2. Go to any page with an off canvas dialog with a submit button. ( For example in the module Layout Builder.)
3. Observe the size of the button

Testing Results
Patch applied cleanly and Olivero: submit button isn't looking wide in the off canvas dialog box

Attaching before and after screenshot.

Hence it can be move to RTBC
RTBC++

Thanks!

smustgrave’s picture

Status: Needs review » Needs work

Fixes should be in MRs

Leaving issue summary tag as the User interface changes section is still empty.

jvbrian’s picture

Status: Needs work » Needs review

The button should be disabled when making a post if any required field in the form is empty.

smustgrave’s picture

Status: Needs review » Needs work

#26 is still needed

bnjmnm’s picture

#21 also needed. The only change made since then was changing the order of CSS rules - nothing to address the feedback.

akshaydalvi212’s picture

Assigned: Unassigned » akshaydalvi212

akshaydalvi212’s picture

Assigned: akshaydalvi212 » Unassigned
Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Needs work

@akshaydalvi212 thanks for working on it but please read the comments @28 mentions that #21 still needed and #29 mentions #21 still needed

From what I can tell the patch was just turned to an MR.

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

smovs’s picture

Status: Needs work » Needs review

I've updated MR!9477.

There are no reasons for "float: left".
Changed the width of the button to auto and restricted max-width to 100%.

Please review.

jimiobrien changed the visibility of the branch 3213995-olivero-submit-button to hidden.

rodrigoaguilera changed the visibility of the branch 3213995-olivero-submit-button to active.

rodrigoaguilera’s picture

Issue tags: +Barcelona2024

@jimiobrien Was hiding the branch an accident?

rodrigoaguilera’s picture

Status: Needs review » Needs work

A look at the failing tests is needed

bnjmnm’s picture

Component: settings_tray.module » CSS
Issue summary: View changes

It was correctly pointed out in #6 that this is not specific to Olivero, but the issue summary was still specifying that. The solution will likely be inside the off-canvas reset CSS in core/misc/dialog/off-canvas/css/

groendijk’s picture

Just thinking.. In /web/core/misc/dialog/off-canvas/css/button.css the #drupal-off-canvas-wrapper .button is set to a width: 100%;.
If the dialog is on the right side of the (desktop) screen I guess it's designed to be as wide as the dialog. If the dialog is at the top or at mobile, it indeed looks a bit strange. I think it would look strange in all themes. Wouldn't it then be better to fix this in the dialog off-canvas button css file and maybe remove the width: 100% over there, or alternatively check if dialog is at left/right side and set the width to 100%?
----
edit: yeah what @bnjmnm says

groendijk’s picture

Going to work on this issue on DrupalCon Barcalona 2024. Chris Darke was my mentor. Discussed this issue with Ben. Going to start a new branch and start from there.

groendijk’s picture

Status: Needs work » Needs review

I've created the Merge Request. Can someone review it? https://git.drupalcode.org/project/drupal/-/merge_requests/9648

chrisdarke’s picture

I have been helping groendijk with this issue

bnjmnm’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs issue summary update

The cspell error in DrupalCI appears unrelated to the MR. As far as the code changes go, this is RTBC but (as one might assume) should not be committed until whatever underlying issue causing the cspell failures is addressed. We can try re-running it later.

bnjmnm’s picture

Status: Reviewed & tested by the community » Postponed

It may take a bit to address the gitlab thing so changing status as to not confuse any committers - but this is effectively RTBC as soon as the gitlab diff is worked out and cspell runs green

bnjmnm changed the visibility of the branch 11.x to hidden.

bnjmnm’s picture

Issue summary: View changes
Status: Postponed » Needs work

I was pleased enough by the code that I forgot some housekeeping stuff: The issue summary should provide before/after screenshots with the after using the current MR.

The MR itself is RTBC IMO

groendijk’s picture

StatusFileSize
new28.54 KB
new48.89 KB
new48.58 KB
new36.89 KB

Housekeeping: Added 4 screenshots.
before - looks good, wide version doesnt.
after - looks good, wide version also.

bnjmnm’s picture

Issue summary: View changes
Status: Needs work » Reviewed & tested by the community

TY for the screenshots - I added them to the issue summary and this is back to RTBC.

  • nod_ committed fc0b1b87 on 10.3.x
    Issue #3213995 by groendijk, bnjmnm, gauravvvv, smovs, cindytwilliams,...

  • nod_ committed 687a650a on 10.4.x
    Issue #3213995 by groendijk, bnjmnm, gauravvvv, smovs, cindytwilliams,...

  • nod_ committed 62822617 on 11.0.x
    Issue #3213995 by groendijk, bnjmnm, gauravvvv, smovs, cindytwilliams,...

  • nod_ committed 808ceae4 on 11.x
    Issue #3213995 by groendijk, bnjmnm, gauravvvv, smovs, cindytwilliams,...
nod_’s picture

Version: 11.x-dev » 10.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed 808ceae426b to 11.x and 628226171fc to 11.0.x and 687a650a490 to 10.4.x and fc0b1b87739 to 10.3.x. Thanks!

Status: Fixed » Closed (fixed)

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