Hidden admin form element is not always hidden

Created on 24 August 2023, about 1 year ago
Updated 29 August 2023, about 1 year ago

There is a field on the powertagging config form that should be hidden, but can sometimes be visible when used with certain admin themes:

      // Vocabulary selection.
      // Hidden field for the selecting the vocabulary.
      // It checks the availability of a language.
      $form['project_settings']['no_language_selected'] = [
        '#type' => 'checkbox',
        '#default_value' => FALSE,
        '#attributes' => ['class' => ['hidden']],
        '#states' => ['checked' => $states],
      ];

The 'hidden' class is not always respected. I suggest just adding the display: none style to it:

      // Vocabulary selection.
      // Hidden field for the selecting the vocabulary.
      // It checks the availability of a language.
      $form['project_settings']['no_language_selected'] = [
        '#type' => 'checkbox',
        '#default_value' => FALSE,
        '#attributes' => [
          'style' => 'display: none',
        ],
        '#states' => ['checked' => $states],
      ];
🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇷🇴Romania stefan.butura

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

Comments & Activities

Production build 0.71.5 2024