File tree Expand file tree Collapse file tree
src/lib/components/chat/ModelSelector Expand file tree Collapse file tree Original file line number Diff line number Diff line change 439439
440440<DropdownMenu .Root
441441 bind:open ={show }
442- onOpenChange ={async ( ) => {
443- searchValue = ' ' ;
444- listScrollTop = 0 ;
445- window . setTimeout (() => document . getElementById ( ' model-search-input ' )?. focus (), 0 ) ;
446-
447- resetView ();
442+ onOpenChange ={( open ) => {
443+ if ( open ) {
444+ searchValue = ' ' ;
445+ listScrollTop = 0 ;
446+ resetView ();
447+ }
448448 }}
449449 onOpenChangeComplete ={(open ) => {
450450 if (! open ) {
494494 align ={$mobile ? ' center' : ' start' }
495495 sideOffset ={2 }
496496 alignOffset ={- 1 }
497+ onOpenAutoFocus ={(e ) => {
498+ e .preventDefault ();
499+ window .setTimeout (() => document .getElementById (' model-search-input' )?.focus (), 0 );
500+ }}
497501 >
498502 {#snippet child ({ wrapperProps , props , open })}
499503 {#if open }
You can’t perform that action at this time.
0 commit comments