Drupal-Modals have 0 height

Created on 11 May 2025, 3 months ago

Problem/Motivation

For editing the different tasks etc. drupal-modals are used. In GIN, those modals end up with 0 max-height:

<div id="drupal-modal" class="ui-front ui-dialog-content ui-widget-content" style="width: auto; min-height: 0px; max-height: 0px; height: auto;">

The module can not be configured in this way.

🐛 Bug report
Status

Active

Version

4.1

Component

User interface

Created by

🇦🇹Austria ChrisZZ Vienna

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

Comments & Activities

  • Issue created by @ChrisZZ
  • 🇦🇹Austria ChrisZZ Vienna
  • 🇨🇦Canada _randy

    Ok. Just to be sure, you see it working in the Claro theme?

    We set the modal in code like this:

    $form['edit_task_complete'] = [
        // In the UI to be editing.
          '#type' => 'link',
          '#title' => 'Edit Task',
          '#prefix' => '<div class="maestro_hidden_element">',
          '#suffix' => '</div>',
          '#url' => Url::fromRoute('maestro_template_builder.edit_task', ['templateMachineName' => $templateMachineName]),
          '#attributes' => [
            'class' => ['use-ajax'],
            'data-dialog-type' => 'modal',
            'data-dialog-options' => Json::encode([
              'width' => '90%',
              'height' => '100%',
              'dialogClass' => 'modal-task-edit',
              'position' => [
                'my' => 'center',
                'at' => 'center',
              ],
            ]),
          ],
        ];

    Where we set the width and height, which is indeed reflected in the outer modal DIV:

    <div style="position: fixed; height: auto; width: 90%; top: 26.46px; left: 107.2px;" tabindex="-1" role="dialog" aria-modal="true" class="ui-dialog modal-task-edit ui-widget ui-widget-content ui-front ui-dialog-buttons" aria-labelledby="ui-id-12">

    Same DIV output you've shown exists and works in Claro.

    Let me know if you've come up with a GIN-specific fix. If not, I'll have to dig into this a bit further.

    • _randy committed 0ac5fa24 on 4.x
      Issue #3523806 by _randy: Drupal-Modals have 0 height
      
  • 🇨🇦Canada _randy

    @chriszz
    I've pushed a fix for this. You can try the DEV release or wait until I roll a new version (coming soon).

    Works for Claro and Gin (and should work for other themes as well)

Production build 0.71.5 2024