Skip to content

Commit

Permalink
Enhance accessibility by adding ARIA attributes and making thinking m…
Browse files Browse the repository at this point in the history
…essage focusable (#1087)

Co-authored-by: amitjoshi <[email protected]>
  • Loading branch information
amitjoshi438 and amitjoshi authored Jan 2, 2025
1 parent b9db334 commit 8c7d844
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/common/copilot/assets/scripts/copilot.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,9 @@
const thinking = document.createElement("div");
thinking.classList.add("thinking");
thinking.innerText = thinkingMessage;
thinking.setAttribute("aria-live", "assertive"); // Add aria-live attribute
thinking.setAttribute("tabindex", "0"); // Make the element focusable
thinking.setAttribute("role", "status"); // Add ARIA role
thinking.setAttribute("aria-live", "polite"); // Ensure screen readers announce updates

messageElement.appendChild(thinking);
chatMessages.scrollTop = chatMessages.scrollHeight - chatMessages.clientHeight;
Expand Down

0 comments on commit 8c7d844

Please sign in to comment.