Skip to content

Conversation

@pwntr
Copy link

@pwntr pwntr commented Nov 11, 2025

Addresses #41005 to get rid of the aria-hidden not applied warnings logged in the browser console.

Example warning message:

(index):1 Blocked aria-hidden on an element because its descendant retained focus. The focus must not be hidden from assistive technology users. Avoid using aria-hidden on a focused element or its ancestor. Consider using the inert attribute instead, which will also prevent focus. For more 
details, see the aria-hidden section of the WAI-ARIA specification at https://w3c.github.io/aria/#aria-hidden.
Element with focus: <div.modal fade#myModal>
Ancestor with aria-hidden: <div.modal fade#myModal> <div class=​"modal fade" id=​"myModal" tabindex=​"-1" aria-labelledby=​"myModalLabel" style=​"display:​ block;​" aria-hidden=​"true">​…​</div>

EDIT: added explicit tests for this inert attribute fix

Description

added inert attribute to the modal on hide, remove it on show

Motivation & Context

#41005

Type of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would change existing functionality)

Checklist

  • I have read the contributing guidelines
  • My code follows the code style of the project (using npm run lint)
  • My change introduces changes to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

Live previews

Related issues

#41005

…nagement for modals. Addresses warnings logged in console about this behavior, see: twbs#41005 (comment)
@pwntr pwntr requested a review from a team as a code owner November 11, 2025 15:40
@pwntr pwntr mentioned this pull request Nov 11, 2025
3 tasks
@kassiabdennacer37-hue
Copy link

<title>WhatsApp Dashboard</title>

Send WhatsApp Message

Phone:
<label>Message:</label>
<textarea id="message" required></textarea>

<button type="submit">Send</button>
<script> document.getElementById("form").addEventListener("submit", async e => { e.preventDefault(); const to = document.getElementById("to").value; const message = document.getElementById("message").value; const res = await fetch("/send", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ to, message }) }); const data = await res.json(); alert("Message sent!"); }); </script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants