From 8a0acabe1062dad12d7a14dafb00548db5923643 Mon Sep 17 00:00:00 2001 From: amitjoshi Date: Thu, 2 Jan 2025 15:28:44 +0530 Subject: [PATCH] Enhance accessibility by adding ARIA attributes and making thinking message focusable --- src/common/copilot/assets/scripts/copilot.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/common/copilot/assets/scripts/copilot.js b/src/common/copilot/assets/scripts/copilot.js index 328119ef..f33c4a80 100644 --- a/src/common/copilot/assets/scripts/copilot.js +++ b/src/common/copilot/assets/scripts/copilot.js @@ -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;