Problem/Motivation

The dropdown component does not show the desired arrow on open state, because the css is()-Function is not usable for pseudo elements (see https://developer.mozilla.org/en-US/docs/Web/CSS/:is#is_does_not_select_pseudo-elements).

Steps to reproduce

1) Use Olivero as default theme.
2) Go to a page which have a dropdown component.
3) Open a dropdown with more than one child.
4) The arrow shows to bottom on closed stated and on open state it should still the same arrow.

Currently
Before

Updated
After

Proposed resolution

Move the @nest rule outside of the ::before pseudo element in Line 69 of the dropdown.pcss.css:

  &::before {
    display: block;
    width: var(--sp0-5);
    height: var(--sp0-5);
    content: "";
    transform: translateY(-25%) rotate(45deg);
    border-right: solid 2px var(--dropbutton--outline-color);
    border-bottom: solid 2px var(--dropbutton--outline-color);
  }
  
  @nest .dropbutton-wrapper.open & {
    transform: translateY(25%) rotate(225deg);
  }

instead of:

  &::before {
    display: block;
    width: var(--sp0-5);
    height: var(--sp0-5);
    content: "";
    transform: translateY(-25%) rotate(45deg);
    border-right: solid 2px var(--dropbutton--outline-color);
    border-bottom: solid 2px var(--dropbutton--outline-color);

    @nest .dropbutton-wrapper.open & {
      transform: translateY(25%) rotate(225deg);
    }
  }

Issue fork drupal-3518192

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

joville created an issue. See original summary.

joville changed the visibility of the branch 3518192-dropdown-does-not to hidden.

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

jatingupta40’s picture

Hello @joville
Can you please share few more details like a screenshot of the issue or anything else because i am not able to reproduce this issue on my end.
Thanks.

joville’s picture

There you see the screenshots about this issue.

sandip’s picture

Status: Active » Needs review
StatusFileSize
new116.71 KB
new128.79 KB

Hi @joville, Reproduced this issue in my local successfully. To reproduce this issue i make olivero as Admin theme and go to the /admin/structure/block page. Also changes in the MR not seems to effect any regression. Moving this to Needs Review so maintainers can share their feedback on it.

kanchan bhogade’s picture

StatusFileSize
new26.65 KB
new18.79 KB

Hi
I have tested MR 11790 on Drupal version 11.x
The MR is applied successfully, but in issue summary MR is Open Failed Pipeline.

The Dropdown arrow functions as expected after applied MR.

, but in issue summary MR is Open Failed Pipeline.

Moving to Needs work

kanchan bhogade’s picture

Status: Needs review » Needs work
sandip’s picture

Status: Needs work » Needs review

Hi @kanchan bhogade, i think the failure of pipeline is not related to the file changes in the MR. Can you please check it once.

ressa’s picture

Issue summary: View changes

It does look unrelated, @sandip you can always try to run that specific failing test again, to make it go green?

Also, adding the GIF's in the Issue Summary, to show visually what this issue is about.

sandip’s picture

After running the failed tests the pipeline is green now.

snehal-chibde’s picture

StatusFileSize
new98.16 KB
new98.14 KB

Hello, I have tested the MR on Drupal version 11.2.x, in Olivero Theme and it is working as expected.
Added before and after screenshots for reference.

sandip’s picture

Status: Needs review » Reviewed & tested by the community

I think we can move this issue to RTBC as the MR provided by @joville fix the issue correctly as i mention in #8

needs-review-queue-bot’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new91 bytes

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

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

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

jatingupta40’s picture

Status: Needs work » Needs review

The patch applied cleanly and it the dropdown is working fine.
Moving it again to In Review.

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

igorgoncalves’s picture

Thanks @jatingupta40

the MR was showing a red line at csslint:
"description":"Unexpected deprecated at-rule \"@nest\" (at-rule-no-deprecated)"

I committed a fix and Lint looks all green now.

I also applied the last changed patch, and the bug is fixed.

kanchan bhogade’s picture

StatusFileSize
new55.99 KB

Hi
I have tested MR 11790 on Drupal 11.x
With MR Dropdown shows desired arrow on open state
Attaching SS for reference

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

arunsahijpal’s picture

StatusFileSize
new69.52 KB

I think the issue is fixed now pls check.
As I am unable to reproduce it.

sandip’s picture

Status: Needs review » Reviewed & tested by the community

Hi @arunsahijpal, it is supposed to test the issue in Olivero theme. By looking at your attached image it seems you are testing it in Claro theme.

I tested the MR in local and as the conflicts is resolved and the before and after images are identical to the one that I already attached in comment #8, so I’m not reattaching any images to avoid unnecessary polute.

So moving this issue to RTBC.

  • nod_ committed 2732a4f2 on 11.2.x
    Issue #3518192 by joville, igorgoncalves, sandip, ressa: Dropdown does...

  • nod_ committed 601118ff on 11.x
    Issue #3518192 by joville, igorgoncalves, sandip, ressa: Dropdown does...
nod_’s picture

Version: 11.x-dev » 10.6.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed 2732a4f and pushed to 11.2.x. Thanks!
We need a MR for 10.6.x and below. Cherry pick isn't clean

sandip’s picture

I am working on creating the MR for 10.6.x

sandip’s picture

Status: Patch (to be ported) » Needs review

Hi @nod_, I have created the MR. As @nest is removed from all stylesheets in latest 11 version but it is still in use in 10 versions. So i thought not to use @nest here as it is removed in 11 versions.

Please share your thought if it is correct or do i need to add @nest here for 10.6.x

igorgoncalves’s picture

Thanks @sandip

I just check your MR for 10.6.x, and works as expected and fixes the issue.

RTBC +1

jatingupta40’s picture

Thanks @sandip!

Yes, good call — maintaining compatibility across versions is a good call.
The MR targeting 10.6.x looks good and clean.

RTBC+1

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Seems like a good backport.

nod_’s picture

Version: 10.6.x-dev » 11.2.x-dev
Status: Reviewed & tested by the community » Fixed

Sorry late to the follow-up. Since we have different rules between 10.x and 11.x I'd rather avoid the inconsistency and not backport this.

Thanks for the dedicated MR though!

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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