How to close a modal

Created on 8 July 2025, about 2 months ago

Problem/Motivation

Opening a modal works fine, but there does not seem to be a straightforward way to close it. There is no cancel button available in the block configuration modals. And pressing the escape key does not work initially because the modal does not gain focus when it is opened. Is anyone else experiencing this?

πŸ› Bug report
Status

Active

Version

1.3

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States MegaKeegMan

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

Comments & Activities

  • Issue created by @MegaKeegMan
  • πŸ‡ΊπŸ‡ΈUnited States MegaKeegMan

    I just switched my admin theme from gin to claro to see if the issue persisted, and it appears that this is only an issue in gin, which seems specific to layout modals. I also tried using Layout Builder Modal, and ran into the same issue. It's interesting that this is only a problem for modals in the layout context.

    Overall, the X not showing up in the top right seems to be more of a gin problem.

    But the modal not gaining focus when opened is a problem for this module.

    Funny that these 2 issues from different places happened for me at the same time and made it difficult to get out of the modal.

  • πŸ‡ΊπŸ‡ΈUnited States kevinquillen

    I also cannot see the Close button in Gin, but I can see it in the source of the modal. I had to write a lot of CSS overrides to get this to work for me in Gin:

    html .ui-dialog .ui-dialog-titlebar .ui-dialog-titlebar-close {
      margin: 12px 5px 0 0 !important;
      padding: 0 !important;
      opacity: 1 !important;
      inline-size: 25px;
      background: none;
    }
    
    html .ui-dialog .ui-dialog-titlebar .ui-dialog-titlebar-close .ui-icon.ui-icon-closethick {
      background: #fff !important;
    }

    Now I can see the close icon.

Production build 0.71.5 2024