The message theme function (/core/misc/message.js
) does not allow additional HTML attributes and CSS classes to be added. Additional HTML attributes such as aria-live
may be needed for accessability reasons. Adding custom CSS classes may be needed to find DOM elements in JavaScript/AJAX or customize styling.
An example of this need is the managed file upload error message in: /core/modules/file/file.js
$(this)
.closest('div.js-form-managed-file')
.prepend(
`<div class="messages messages--error file-upload-js-error" aria-live="polite">${error}</div>`,
);
To replace the hardcoded message markup with the message JS theme function it would require adding the aria-live="polite"
attribute and the CSS class file-upload-js-error
.
N/A
Allow custom HTML attributes and CSS classes to be passed to the message JS theme function.
N/A
N/A
N/A
N/A
N/A
Active
11.0 π₯
javascript