fix: preserve initial focus and guard account appearance saves
This commit is contained in:
1 parent
cd7d7d6251
commit
e59c7123cf
2 files changed
+3
-2
No files matched your search
+2
-1
@@ -91,10 +91,11 @@ function handleProgress(data) {
|
||||
setState(working ? "thinking" : "listening");
|
||||
}
|
||||
function setTasksOpen(open) {
|
||||
const wasOpen = !tasksPanel.hidden;
|
||||
tasksPanel.hidden = !open; tasksPanel.inert = !open;
|
||||
tasksPanel.classList.toggle("open", open);
|
||||
tasksBtn.setAttribute("aria-expanded", String(open));
|
||||
if (open) closeTasksBtn.focus(); else tasksBtn.focus();
|
||||
if (open) closeTasksBtn.focus(); else if (wasOpen) tasksBtn.focus();
|
||||
}
|
||||
tasksBtn.setAttribute("aria-expanded", "false");
|
||||
tasksBtn.addEventListener("click", () => setTasksOpen(!tasksPanel.classList.contains("open")));
|
||||
|
||||
Reference in new issue
Block a user