mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-29 06:32:52 +00:00
fix(a11y): closing the model picker returns focus to its button when Accessibility Mode is on (#33062)
This commit is contained in:
parent
42daa30e96
commit
b48337630b
1 changed files with 12 additions and 1 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue