File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " bits-ui " : patch
3
+ ---
4
+
5
+ fix(Select): ensure typeahead enabled state is reactive to item updates
Original file line number Diff line number Diff line change @@ -550,7 +550,7 @@ class SelectTriggerState {
550
550
if ( ! matchedItem ) return ;
551
551
this . root . opts . value . current = matchedItem . value ;
552
552
} ,
553
- enabled : ! this . root . isMulti && this . root . dataTypeaheadEnabled ,
553
+ enabled : ( ) => ! this . root . isMulti && this . root . dataTypeaheadEnabled ,
554
554
candidateValues : ( ) => ( this . root . isMulti ? [ ] : this . root . candidateLabels ) ,
555
555
getWindow : ( ) => this . root . domContext . getWindow ( ) ,
556
556
} ) ;
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ type UseDataTypeaheadOpts = {
8
8
onMatch : ( value : string ) => void ;
9
9
getCurrentItem : ( ) => string ;
10
10
candidateValues : Getter < string [ ] > ;
11
- enabled : boolean ;
11
+ enabled : Getter < boolean > ;
12
12
getWindow : ( ) => Window & typeof globalThis ;
13
13
} ;
14
14
@@ -21,7 +21,7 @@ export function useDataTypeahead(opts: UseDataTypeaheadOpts) {
21
21
const candidateValues = $derived ( opts . candidateValues ( ) ) ;
22
22
23
23
function handleTypeaheadSearch ( key : string ) {
24
- if ( ! opts . enabled ) return ;
24
+ if ( ! opts . enabled ( ) ) return ;
25
25
if ( ! candidateValues . length ) return ;
26
26
27
27
search . current = search . current + key ;
You can’t perform that action at this time.
0 commit comments