File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,6 @@ export default class Combobox {
67
67
; ( this . input as HTMLElement ) . addEventListener ( 'keydown' , this . keyboardEventHandler )
68
68
this . list . addEventListener ( 'click' , commitWithElement )
69
69
this . indicateDefaultOption ( )
70
- this . focusDefaultOptionIfNeeded ( )
71
70
}
72
71
73
72
stop ( ) : void {
@@ -85,11 +84,7 @@ export default class Combobox {
85
84
Array . from ( this . list . querySelectorAll < HTMLElement > ( '[role="option"]:not([aria-disabled="true"])' ) )
86
85
. filter ( visible ) [ 0 ]
87
86
?. setAttribute ( 'data-combobox-option-default' , 'true' )
88
- }
89
- }
90
-
91
- focusDefaultOptionIfNeeded ( ) : void {
92
- if ( this . firstOptionSelectionMode === 'selected' ) {
87
+ } else if ( this . firstOptionSelectionMode === 'selected' ) {
93
88
this . navigate ( 1 )
94
89
}
95
90
}
@@ -133,7 +128,10 @@ export default class Combobox {
133
128
for ( const el of this . list . querySelectorAll ( '[aria-selected="true"]' ) ) {
134
129
el . removeAttribute ( 'aria-selected' )
135
130
}
136
- this . indicateDefaultOption ( )
131
+
132
+ if ( this . firstOptionSelectionMode === 'active' ) {
133
+ this . indicateDefaultOption ( )
134
+ }
137
135
}
138
136
}
139
137
You can’t perform that action at this time.
0 commit comments