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

This commit is contained in:
G30 2026-10-23 22:07:28 -04:00 • committed by GitHub
parent 42daa30e96
commit b48337630b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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();
}
}
};