fix(a11y): closing the model picker returns focus to its button when Accessibility Mode is on (#33062)

This commit is contained in:
G30 authored and GitHub committed 2026-10-24 11:07:28 +09:00
1 parent 42daa30e96
commit b48337630b
1 file changed
+12 -1
@@ -132,6 +132,13 @@
if (!$mobile) {
document.getElementById('chat-input')?.focus();
}
if (
$settings?.highContrastMode &&
(document.activeElement === document.body || contentElement?.contains(document.activeElement))
) {
document.getElementById(`model-selector-${id}-button`)?.focus();
}
};
const toggleOpen = async () => {
@@ -181,7 +188,11 @@
e.preventDefault();
e.stopPropagation();
show = false;
document.getElementById(`model-selector-${id}-button`)?.blur();
if ($settings?.highContrastMode) {
document.getElementById(`model-selector-${id}-button`)?.focus();
} else {
document.getElementById(`model-selector-${id}-button`)?.blur();
}
}
};