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 {
6767 ; ( this . input as HTMLElement ) . addEventListener ( 'keydown' , this . keyboardEventHandler )
6868 this . list . addEventListener ( 'click' , commitWithElement )
6969 this . indicateDefaultOption ( )
70- this . focusDefaultOptionIfNeeded ( )
7170 }
7271
7372 stop ( ) : void {
@@ -85,11 +84,7 @@ export default class Combobox {
8584 Array . from ( this . list . querySelectorAll < HTMLElement > ( '[role="option"]:not([aria-disabled="true"])' ) )
8685 . filter ( visible ) [ 0 ]
8786 ?. setAttribute ( 'data-combobox-option-default' , 'true' )
88- }
89- }
90-
91- focusDefaultOptionIfNeeded ( ) : void {
92- if ( this . firstOptionSelectionMode === 'selected' ) {
87+ } else if ( this . firstOptionSelectionMode === 'selected' ) {
9388 this . navigate ( 1 )
9489 }
9590 }
@@ -133,7 +128,10 @@ export default class Combobox {
133128 for ( const el of this . list . querySelectorAll ( '[aria-selected="true"]' ) ) {
134129 el . removeAttribute ( 'aria-selected' )
135130 }
136- this . indicateDefaultOption ( )
131+
132+ if ( this . firstOptionSelectionMode === 'active' ) {
133+ this . indicateDefaultOption ( )
134+ }
137135 }
138136}
139137
You can’t perform that action at this time.
0 commit comments