fix(agents): prevent model selection failures in WebKit
- Preserve focus during picker clicks to prevent premature dropdown dismissal - Add model picker regression tests for Chromium and WebKit
This commit is contained in:
1 parent
5260ec5a2f
commit
dc16fe1a84
4 files changed
+412
No files matched your search
@@ -599,6 +599,12 @@ function AgentModelPicker({
|
||||
|
||||
return (
|
||||
<div className={`agent-model-picker ${open ? 'open' : ''}`} ref={rootRef}
|
||||
onMouseDown={(event) => {
|
||||
if (event.button === 0 && event.currentTarget.contains(document.activeElement)
|
||||
&& event.target instanceof Element && event.target.closest('button')) {
|
||||
event.preventDefault();
|
||||
}
|
||||
}}
|
||||
onBlur={(event) => {
|
||||
if (!event.currentTarget.contains(event.relatedTarget as Node | null)) setOpen(false);
|
||||
}}>
|
||||
|
||||
Reference in new issue
Block a user