Problem/Motivation

If I increase or decrease the font size in my browser, dropbuttons get a weird white line along the bottom.

This also occurs while zooming in/out. This happens in some zoom settings but not others.

Steps to reproduce

1 Go to a page with a dropbutton such as admin/structure/types
2 Change browser font size

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3316627

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

joachim created an issue. See original summary.

akshaydalvi212’s picture

Status: Active » Needs review
StatusFileSize
new1.36 KB

Hello,

Providing the patch, Kindly review it.

Thanks and regards.

_utsavsharma’s picture

Can you elaborate more , why you need to need to change the font-size.?

mukhtarm’s picture

Hi @joachim the question is valid on #3. Also i couldn't find a difference when increasing or decreasing the browser font size to large/ extra large from medium (recommended) when a tested a dropdown field in a content type.

Tested OS: Mac
Browser: Chrome

joachim’s picture

> Can you elaborate more , why you need to need to change the font-size.?

People need to change the font size of their browser all the time. To read small text more easily, or to fit more text on the screen, for instance.

I was seeing this problem on Firefox on a Mac.

bebalachandra’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new90.66 KB

Everything looks good for me. Tested on google chrome and mozilla firefox (mac). Everything is fine without any patch.
attaching screenshot for reference.

joachim’s picture

Status: Reviewed & tested by the community » Needs work

The patch doesn't apply.

sakthivel m’s picture

Status: Needs work » Needs review
StatusFileSize
new1.26 KB

#8 Please review the patch

joachim’s picture

I applied the patch, did a drush cr, and I still get the line on larger font sizes.

asha nair’s picture

Applied patch. The bottom white line is still there, but white line at the right side disappears.

asha nair’s picture

Status: Needs review » Needs work
StatusFileSize
new3.56 KB
new3.72 KB
sakthivel m’s picture

Status: Needs work » Needs review
StatusFileSize
new1.99 KB

#12 Please review the patch

asha nair’s picture

StatusFileSize
new4.13 KB

Applied patch in #12. The patch removes all the white lines of button in Mozilla and Chrome.

gaurav-mathur’s picture

Assigned: Unassigned » gaurav-mathur
StatusFileSize
new162.26 KB
new162.8 KB

I am also Applied this patch in #12.
The patch removes all the white lines of dropdown button in Chrome.

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

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should 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.

gauravvvv’s picture

StatusFileSize
new2.54 KB

Patch #12, no longer applies to 10.1.x. I have re-rolled the patch. Along with that instead of margin-right I have used margin-inline-end so we don't need to write it again for RTL. Please review.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new85 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

nod_’s picture

Version: 9.5.x-dev » 10.1.x-dev
Status: Needs work » Needs review

Issue version was not updated. Bot checked against wrong branch.

deepalij’s picture

StatusFileSize
new28.24 KB
new26.81 KB

Able to reproduce the issue using steps in IS
Verified and tested patch #16 on Drupal 10.1.x-dev
The patch applied cleanly
The issue got resolved after applying the patch. Now, the white line doesn't appear when the font size is reduced
Refer to the attached screenshots

Before:
before

After:
after

RTBC +1

smustgrave’s picture

For me this is a won't fix because this is a button + dropdown. That little space provides some separation but without it the two blend together.

Will post in #frontend

larowlan’s picture

Status: Needs review » Needs work

Yeah, I think removing the vertical line is out of scope.

The issue summary is about removing the bottom line.

akshay kashyap’s picture

StatusFileSize
new1.13 KB

Providing the patch, Please review it.

akshay kashyap’s picture

Status: Needs work » Needs review
akshay kashyap’s picture

StatusFileSize
new37.51 KB
tanuj.’s picture

StatusFileSize
new158.48 KB
new179.81 KB
new211.99 KB

Cannot reproduce this issue on Drupal: 10.1.x, tried it on different browsers and with different font sizes. Attaching screenshots for reference.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative

Build failure in #22

gauravvvv’s picture

Status: Needs work » Needs review
StatusFileSize
new2.63 KB
new1.34 KB

Addressed #21, attached interdiff with #16.

#22, introduced a new solution, that is not aligned with the earlier ones.

akshay kashyap’s picture

StatusFileSize
new10.78 KB
new69.24 KB

@Gauravvvv Thanks for the Patch. I tested Patch #27 and it is working fine. Please find the attached image for the results.

Thank You!!

aziza_a’s picture

Status: Needs review » Reviewed & tested by the community

Checked the patch given in #27 working fine as expected

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 27: 3316627-27.patch, failed testing. View results

bnjmnm’s picture

Title: dropbuttons get weird white line when font size is changed » dropbuttons get weird white line when font size is changed and at at various zoom settings
Issue summary: View changes

bnjmnm’s picture

Status: Needs work » Needs review

I tried the various patches here and all of them had issues at certain zoom settings. MR has a solution that I believe works at all zoom settings, and a reviewer can confirm or disprove this 😎

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Tested the MR3768 and did not see any issue when zooming in and out. Used chrome for testing.

larowlan’s picture

Crediting @smustgrave for changing the course of the issue and @Asha Nair for the first screenshots

larowlan’s picture

Manually tested this and confirmed the white box at the bottom is gone.

Crediting joachim for reporting.

  • larowlan committed fdebc9a9 on 10.0.x
    Issue #3316627 by bnjmnm, Gauravvvv, Sakthivel M, Akshay kashyap, Asha...

  • larowlan committed 58f00eff on 10.1.x
    Issue #3316627 by bnjmnm, Gauravvvv, Sakthivel M, Akshay kashyap, Asha...
larowlan’s picture

Version: 10.1.x-dev » 9.5.x-dev
Status: Reviewed & tested by the community » Fixed
Issue tags: +Bug Smash Initiative

Committed to 10.1.x and backported to 10.0.x and 9.5.x

  • larowlan committed 4172f231 on 9.5.x
    Issue #3316627 by bnjmnm, Gauravvvv, Sakthivel M, Akshay kashyap, Asha...
gauravvvv’s picture

Status: Reviewed & tested by the community » Fixed

Updating status

longwave’s picture

Version: 10.1.x-dev » 9.5.x-dev
Status: Fixed » Needs work

Reverting this from 9.5.x, while this cherry-picked cleanly, yarn build gives a different result:

diff --git a/core/themes/claro/css/components/dropbutton.css b/core/themes/claro/css/components/dropbutton.css
index fa35ce738f..15d9a3fba1 100644
--- a/core/themes/claro/css/components/dropbutton.css
+++ b/core/themes/claro/css/components/dropbutton.css
@@ -67,12 +67,16 @@
 }
 
 .js .dropbutton-widget {
-  border-radius: var(--button-border-radius-size);
-  background-color: var(--button-bg-color);
+  border-radius: 2px;
+  background-color: #d3d4d9;
+}
+
+[dir="ltr"] .js .dropbutton-action {
+  border-right: 1px solid white;
 }
 
-.js .dropbutton-action {
-  border-inline-end: var(--dropbutton-border-size) solid white;
+[dir="rtl"] .js .dropbutton-action {
+  border-left: 1px solid white;
 }
 
 /* Variants. */

This is presumably because we can't use CSS variables or logical properties on IE11 in 9.5.x, and so PostCSS builds the resulting CSS differently.

  • longwave committed afb24c3d on 9.5.x
    Revert "Issue #3316627 by bnjmnm, Gauravvvv, Sakthivel M, Akshay kashyap...
longwave’s picture

Status: Needs work » Needs review
StatusFileSize
new1.23 KB
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Good catch!

  • larowlan committed a0280e64 on 9.5.x
    Issue #3316627 by bnjmnm, Gauravvvv, Sakthivel M, Akshay kashyap,...
larowlan’s picture

Status: Reviewed & tested by the community » Fixed

Committed the new patch variant to 9.5.x

Lessons learned - 'css only changes' still need testing on lower versions before backport 😀

Thanks @longwave

Status: Fixed » Closed (fixed)

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

pasqualle’s picture

The button background introduced a problem in Gin theme
#3355885: Dropbutton style issue after Claro update

kristen pol’s picture

Was looking at this issue and was surprised that the person who created the issue was not given issue credit... I thought we always give issue credit to the issue creator? In fact, I don't know why that wouldn't just default to being checked. Also, Deepali looks to have genuinely tested a patch that had not been tested yet didn't get credit so I'm unclear on that as well. But since this is marked closed, I don't know if it will be changed.