File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 212212 }}
213213 on: clear
214214 on: clear= {open}
215- on: blur
215+ on: blur= {(e ) => {
216+ // Check if focus is moving to an element within the combobox
217+ const relatedTarget = e .relatedTarget ;
218+ if (relatedTarget && comboboxRef? .contains (relatedTarget)) {
219+ return ;
220+ }
221+ // Close immediately for keyboard navigation (Tab, Shift+Tab)
222+ close ();
223+ }}
216224 on: keydown
217225 on: keydown= {(e ) => {
218226 if (results .length === 0 ) return ;
253261 class: selected= {selectedIndex === index}
254262 class: disabled= {result .disabled }
255263 aria- selected= {selectedIndex === index}
256- on: click= {() => {
264+ on: mousedown= {(e ) => {
265+ // mousedown fires before blur, preventing the dropdown from closing
257266 if (result .disabled ) return ;
267+ e .preventDefault (); // Prevent input from losing focus
258268 selectedIndex = index;
259269 select ();
260270 }}
You can’t perform that action at this time.
0 commit comments