mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix(site/src/pages/AgentsPage/components/ChatElements): keep model picker visible above mobile keyboard (#26964)
This commit is contained in:
@@ -136,10 +136,20 @@ export const ModelSelector: FC<ModelSelectorProps> = ({
|
||||
align={dropdownAlign}
|
||||
className={cn(
|
||||
enableMobileFullWidthDropdown &&
|
||||
"mobile-full-width-dropdown mobile-full-width-dropdown-bottom",
|
||||
"mobile-full-width-dropdown mobile-full-width-dropdown-above-composer",
|
||||
"w-72 overflow-hidden border-border-default p-0",
|
||||
contentClassName,
|
||||
)}
|
||||
onOpenAutoFocus={(event) => {
|
||||
// On touch devices, auto-focusing the search input pops the
|
||||
// software keyboard as soon as the picker opens, hiding the
|
||||
// model list behind it. Only keep the WAI-ARIA combobox
|
||||
// focus-into-input behavior for fine pointers (keyboard and
|
||||
// mouse users on desktop).
|
||||
if (matchMedia("(pointer: coarse)").matches) {
|
||||
event.preventDefault();
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Command
|
||||
shouldFilter={false}
|
||||
|
||||
Reference in New Issue
Block a user