File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
packages/kit-headless/src/components/select Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ export const SelectTrigger = component$<SelectTriggerProps>((props) => {
13
13
const context = useContext ( SelectContextId ) ;
14
14
const openKeys = [ 'ArrowUp' , 'ArrowDown' ] ;
15
15
const closedKeys = [ `Escape` ] ;
16
- const initialIndex = context . highlightedIndexSig . value === - 1 ;
16
+ // const initialIndex = context.highlightedIndexSig.value === -1;
17
17
18
18
// Both the space and enter keys run with handleClick$
19
19
const handleClick$ = $ ( ( ) => {
@@ -49,17 +49,20 @@ export const SelectTrigger = component$<SelectTriggerProps>((props) => {
49
49
context . isListboxOpenSig . value = false ;
50
50
}
51
51
52
- if ( initialIndex ) {
53
- context . highlightedIndexSig . value ++ ;
54
- return ;
55
- }
56
-
57
52
if ( e . key === 'Home' ) {
58
53
context . highlightedIndexSig . value = 0 ;
54
+ console . log ( 'Highlighted index: ' , context . highlightedIndexSig . value ) ;
55
+ return ;
59
56
}
60
57
61
58
if ( e . key === 'End' ) {
62
59
context . highlightedIndexSig . value = context . optionRefsArray . value . length - 1 ;
60
+ return ;
61
+ }
62
+
63
+ if ( context . highlightedIndexSig . value === - 1 ) {
64
+ context . highlightedIndexSig . value ++ ;
65
+ return ;
63
66
}
64
67
65
68
if ( context . isListboxOpenSig . value ) {
You can’t perform that action at this time.
0 commit comments