The title of a dialog modal is getting truncated

Created on 14 June 2025, about 1 month ago

Problem/Motivation

During the review of Open the "discard changes" dialog in the off-canvas tray Active (in #40 Open the "discard changes" dialog in the off-canvas tray Active ) we've noticed that the title of dialog modals in Olivero are getting truncated due to the styling:

If you replace the h1 wrapping the title of the dialog modal with a span with devtools, the title becomes fully legible:

Some context, until a few weeks ago, a span element was used for wrapping the title of dialog (modals) in jQuery UI in Drupal, which was semantically wrong and a problem for screenreader users. 📌 Update to jQuery 1.14.1 and use the newly added option for dialog modal headings Active solved that problem, for dialogs the span got replaced by h2s, and for dialog modals by h1s. In Claro that change caused no visual changes, but I was unaware that dialogs and dialog modals would be available for frontend themes like olivero and umami as well, and therefore have not tested for that detail, which lead to results seen in the screenshots. :/

Steps to reproduce

- apply MR11723 ( Open the "discard changes" dialog in the off-canvas tray Active )
- create a layout in layout builder that is using olivero click the discard.

Proposed resolution

Adjust the styling for h1 and h2 in dialog titles so that the titles are don't get truncated.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

📌 Task
Status

Active

Version

11.0 🔥

Component

Olivero theme

Created by

🇩🇪Germany rkoller Nürnberg, Germany

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

Merge Requests

Comments & Activities

  • Issue created by @rkoller
  • 🇩🇪Germany rkoller Nürnberg, Germany
  • 🇩🇪Germany rkoller Nürnberg, Germany
  • 🇮🇳India sandip

    I am working on it.

  • 🇮🇳India sandip

    While investigating the issue, I finds out the css is coming from core/assets/vendor/jquery.ui/themes/base/dialog.css. There is no dialog.css in olivero so i think it would be better to create a library for dialog in olivero, similar to how it is handled in the Claro theme. So should i create the library in the Olivero?

    The truncating issue would be fixed by removing the text-overflow: elipsis and white-space: no-wrap from h1 tag. This style is coming from core/assets/vendor/jquery.ui/themes/base/dialog.css.

  • 🇩🇪Germany rkoller Nürnberg, Germany

    oh interesting, thanks for investigating! i am not a developer therefore i dont feel qualified to make a recommendations about the approach how to fix a certain problem :/ the only thing i can say, it at least sounds reasonable staying consistent and choose the same approach claro uses.

  • 🇮🇳India sandip

    @rkoller, Thanks for the reply. So I am raising a MR with the approach I mentioned above within tomorrow so it would be great to review then.

  • Pipeline finished with Success
    18 days ago
    Total: 623s
    #532858
  • 🇮🇳India sandip

    Actually, I didn’t need to create a new library as the necessary one is already present, but I missed it yesterday. The truncation issue is now resolved. However, the width of the dialog modal is set to 300px, and at that width, it's not possible to keep the heading on a single line. As a result, the heading is wrapping onto two lines. Could you please review it and let me know if it needs any changes.

Production build 0.71.5 2024