Problem/Motivation

The dropdown selector is visually broken when using the default Claro admin theme

Steps to reproduce

  1. Spin up Drupal 10 (keep using the default admin theme - Claro), install Schedular
  2. Navigate to /admin/config/content/scheduler
  3. Click the dropdown arrow

Issue fork scheduler-3316719

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

jaydee1818 created an issue. See original summary.

Anonymous’s picture

I am not able to reproduce this issue. Please provide few more steps.

jonathan1055’s picture

StatusFileSize
new212.49 KB
new147.14 KB
new137.21 KB

Hi jaydee1818,
Yes I can replicate this in 9.x (not tried in 10.x yet). It seems that the background for non-selectable menu items is transparent in Claro:
Olivero

It is OK in Olivero as the background is solid:
Olivero

For reference here's the same in Seven (although this is deprecated in drupal 9 now)
Olivero

If anujasurve could not replicate it, maybe it is a browser-dependent problem? These shots were on Firefox 105.

FWIW I think Claro is an awful admin theme, far too much wasted space on the page requiring scrolling. Admin themes should be tight and efficient, it's not the front-end view. But that's not a reason not to try to fix this.

The dropdown is not doing anything tricksy. The non-selectable items just have a "title" attribute. Maybe there should be some extra attribute or class added for those?

      $links[] = ['title' => "-- $collection_label --"];
      foreach ($types as $id => $type) {
        $text = [];
        in_array($id, $publishing_enabled_types) ? $text[] = $this->t('publishing') : NULL;
        in_array($id, $unpublishing_enabled_types) ? $text[] = $this->t('unpublishing') : NULL;
        $links[] = [
          'title' => $type->label() . (!empty($text) ? ' (' . implode(', ', $text) . ')' : ''),
          // Example: the route 'entity.media_type.edit_form' with parameter
          // media_type={typeid} has url /admin/structure/media/manage/{typeid}.
          'url' => Url::fromRoute("entity.$bundle_id.edit_form", [$bundle_id => $type->id()]),
        ];
      }
    }
    $form['entity_type_links'] = [
      '#type' => 'dropbutton',
      '#links' => $links,
    ];
jonathan1055’s picture

Title: Schedular settings entity dropdown selector broken in Claro » Scheduler settings entity dropdown selector broken in Claro
jonathan1055’s picture

Status: Active » Needs review
StatusFileSize
new539 bytes
new187.37 KB

Here's a patch for you to try. It solves it for me, but would be good to get others input.

We could raise a core issue to get Claro to add a default background, as contrib modules shoud not need to do this.

claro with background

jonathan1055’s picture

@jaydee1818 have you managed to test the fix yet?

I have raised #3317323: Claro dropbutton non-link items need solid background to get it fixed in Claro, but will also commit this to Scheduler as it could be ages before the core fix is done.

  • jonathan1055 committed 969cf97 on 2.x
    Issue #3316719 by jonathan1055, jaydee1818: Add solid background for non...
jonathan1055’s picture

Status: Needs review » Fixed
Related issues: +#3317323: Claro dropbutton non-link items need solid background

Fixed. Thanks again for reporting this.

Status: Fixed » Closed (fixed)

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