Skip to content

Commit 8c7d844

Browse files
amitjoshi438amitjoshi
andauthored
Enhance accessibility by adding ARIA attributes and making thinking message focusable (#1087)
Co-authored-by: amitjoshi <amitjoshi@microsoft.com>
1 parent b9db334 commit 8c7d844

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/common/copilot/assets/scripts/copilot.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,9 @@
317317
const thinking = document.createElement("div");
318318
thinking.classList.add("thinking");
319319
thinking.innerText = thinkingMessage;
320-
thinking.setAttribute("aria-live", "assertive"); // Add aria-live attribute
320+
thinking.setAttribute("tabindex", "0"); // Make the element focusable
321+
thinking.setAttribute("role", "status"); // Add ARIA role
322+
thinking.setAttribute("aria-live", "polite"); // Ensure screen readers announce updates
321323

322324
messageElement.appendChild(thinking);
323325
chatMessages.scrollTop = chatMessages.scrollHeight - chatMessages.clientHeight;

0 commit comments

Comments
 (0)