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
  • Loading branch information
amitjoshi committed Jan 2, 2025
1 parent 3c2bdf2 commit 8a0acab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/common/copilot/assets/scripts/copilot.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,9 @@
const thinking = document.createElement("div");
thinking.classList.add("thinking");
thinking.innerText = thinkingMessage;
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 8a0acab

Please sign in to comment.