Problem/Motivation

When a #ajax request fails, core's Drupal.AjaxError writes "Oops, something went wrong. Check your browser's developer console for more details." into the page's [data-drupal-messages] region. In expanded mode the builder covers the whole viewport, so the message is never seen and the action just seems to do nothing.

Steps to reproduce

Proposed resolution

Show Ajax errors in the builder's own toast stack, like server errors from RenderableBuilderTrait::buildError().

Core only creates Drupal.AjaxError.messages when none is set, so the builder sets its own, rendering the same alert into its stack, where its live region announces it.

A Playwright test expands the builder, raises the error and checks the toast is visible and not covered.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mogtofu33 created an issue. See original summary.

mogtofu33’s picture

Assigned: mogtofu33 » Unassigned
Status: Needs work » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • mogtofu33 committed 2d21deb8 on 1.0.x
    fix: #3623534 Ajax errors are hidden in expanded mode