Skip to content

Comments

Remove redundant aria label for JS toast messages#19435

Merged
AdrienClairembault merged 3 commits intoglpi-project:mainfrom
cconard96:fix/js_toast_escaping
Apr 12, 2025
Merged

Remove redundant aria label for JS toast messages#19435
AdrienClairembault merged 3 commits intoglpi-project:mainfrom
cconard96:fix/js_toast_escaping

Conversation

@cconard96
Copy link
Contributor

@cconard96 cconard96 commented Apr 11, 2025

Checklist before requesting a review

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my code.

Description

Noticed with Forms that HTML content wasn't handled properly for JS toast messages when using it in an aria-label attribute. It wasn't escaped, but also the label is completely redundant and would be annoying for screen reader users. Change was added in #19355.

The way it was, as soon as the message appeared the screen reader would announce:

  1. The message content
  2. The message title
  3. The close button
  4. The message content

Screenshots (if appropriate):

Selection_463

Copy link
Contributor

@AdrienClairembault AdrienClairembault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think some E2E tests might need it, but ok for me if tests are green

@cconard96
Copy link
Contributor Author

Is there a reason the tests aren't just looking for an alert role element that contains the expected message rather than an alert with the entire message as its name?

@AdrienClairembault
Copy link
Contributor

I think the original issue that lead to this change is that there are two alerts on the page (if I remember correctly).

@AdrienClairembault
Copy link
Contributor

Should be good with your change tho, waiting for the CI to confirm.

@AdrienClairembault AdrienClairembault merged commit fea418e into glpi-project:main Apr 12, 2025
7 checks passed
@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

This PR has been is closed and has been automatically locked. Please open a new issue with all requested information for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants