mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-24 06:20:20 -05:00
fix(a11y): closing the model picker returns focus to its button when Accessibility Mode is on (#33062)
This commit is contained in:
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();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user