Problem/Motivation

When off-canvas dialogs have long titles, the title is truncated. In some cases, the missing text is important to understand the purpose of the dialog.

Example: in layout builder, if you click "remove block", the off-canvas dialog opens, but the visible text is "Are you sure you want to re..."

Firefox 65 screenshot:
Off-canvas dialog shows title truncated with an ellipsis.

The full title is present in the DOM, but is being truncated by CSS. The relevant rule from jQuery UI, in core/assets/vendor/jquery.ui/themes/base/dialog.css:

.ui-dialog .ui-dialog-title {
    white-space: nowrap;
}

This is a WCAG level-A failure (3.3.2 "Labels and instructions).

So far this only seems to be a problem for the off-canvas dialogs. (In centrally positioned dialogs, the title will wrap to a second line when the viewport is narrow.)

Proposed resolution

Don't truncate the dialog title.
If necessary, it should wrap to a second line in the dialog title area.

Remaining tasks

TODO

User interface changes

TODO

Comments

andrewmacpherson created an issue. See original summary.

andrewmacpherson’s picture

Issue tags: -accessibility +Accessibility
Parent issue: » #2919837: Accessibility Issues with Off-Canvas dialog
andrewmacpherson’s picture

Issue tags: +layouts-blocks, +Layout Builder stable blocker

The delete block and remove section dialogs suffer from this in particular.

This isn't actually layout builder's fault, but I think it's a pretty major issue nonetheless. Tentatively marking this as a stable blocker.

I'm not really sure that every task in layout builder should use the off-canvas dialog style. Off-canvas is good for tasks where you don't want to obscure the page content; such as moving a block. But for a danger/confirm question like removing a section, a centrally-placed dialog would be better IMO - it's something urgent which needs to command attention.

andrewmacpherson’s picture

Title: Off-canvas dialog titles should not be truncated » Off-canvas dialog titles should not be visually truncated

Clarifying title. The full dialog title is present in the DOM, so screen readers will convey it. This is a visual problem only.

bnjmnm’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new603 bytes
new29.46 KB
new33.9 KB

Added white-space: normal; to .ui-dialog.ui-dialog-off-canvas .ui-dialog-title.

Before and after screenshots attached.

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -layouts-blocks +Layout Builder frontend issue, +Blocks-Layouts

Thanks for this, that's quite an elegant fix!

xjm’s picture

Status: Reviewed & tested by the community » Fixed

Oh thank goodness. This causes soooo many UX/a11y issues. For this reason, I'm committing this even though it changes Stable, as per the frontend BC policy notes from @Cottser:

Some bugs can also be fixed in the stable base themes (Stable, Classy). These cases generally need to be evaluated on a case-by-case basis. Generally these types of changes need to be evaluated by comparing the potential impact vs. disruption.

Examples of types of bugs that need to be evaluated:

  • Malformed/incorrect markup or output
  • Accessibility fixes
  • Changing markup to work with JavaScript
  • Changing admin-facing markup and CSS

In this case the worst that would happen is ugly output for some themes, which is vastly preferable to critical text being invisible.

As this is a disruptive change (because it changes Stable), I've not backported this fix to 8.6.x.

Thank you for finally fixing this!!

  • xjm committed a5e8d25 on 8.7.x
    Issue #3037124 by bnjmnm, andrewmacpherson: Off-canvas dialog titles...
xjm’s picture

Oops, we also need to change this in core/misc. Tim will post a quick followup for that.

tim.plunkett’s picture

Status: Fixed » Reviewed & tested by the community
StatusFileSize
new531 bytes

Copied 1:1 from stable. Nice catch @xjm!

  • xjm committed 91c0cf1 on 8.7.x
    Issue #3037124 followup by tim.plunkett, xjm: Off-canvas dialog titles...
xjm’s picture

Status: Reviewed & tested by the community » Fixed

Committed the followup. Thanks @tim.plunkett!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.