Hidden buttons in off-canvas dialog are not being hidden

Created on 25 July 2019, over 5 years ago
Updated 31 December 2024, 5 days ago

Button elements that should be hidden with the js.hidden CSS class are not being hidden in the off-canvas dialog. In particular the image field's 'Upload' button.

Here's how we found it:
1. Created a custom block type with an image field.
2. Set a content type to use Layout Builder.
3. Used the Layout Builder to 'Add Custom Block' and chose the custom block type.
4. The image field shows an Upload button that should be hidden.

The problem is a CSS rule in core/misc/dialog/off-canvas.reset.css on line 248. Core correctly applies a class (js-hide) to set display: none, but the drupal-off-canvas css overrides it so it shows up.

from js.module.css:10

.js .js-hide {
    display: none;
}

from off-canvas-reset.css:244

#drupal-off-canvas button,
#drupal-off-canvas input[type="reset"],
#drupal-off-canvas input[type="submit"],
#drupal-off-canvas input[type="button"] {
  display: inline-block;
  overflow: visible;
  cursor: pointer;
  vertical-align: middle;
  text-decoration: none;
  border: 0;
  outline: 0;
  background-image: none;
  text-shadow: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

display: inline-block is overriding display: none in core/modules/system/css/components/js.module.css

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component

settings_tray.module

Created by

πŸ‡ΊπŸ‡ΈUnited States sacarney

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024