File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -248,7 +248,6 @@ export class PfSearchInput extends LitElement {
248248 #onClickCloseButton( ) {
249249 this . _toggleInput ! . value = '' ;
250250 this . #updateValue( this . _toggleInput ?. value ?? '' ) ;
251- this . #combobox. selected = [ ] ;
252251 this . #clickedCloseButton = true ;
253252 this . _toggleInput ?. focus ( ) ;
254253 }
@@ -262,9 +261,6 @@ export class PfSearchInput extends LitElement {
262261
263262 #onChange( ) {
264263 this . #updateValue( this . _toggleInput ?. value ?? '' ) ;
265- if ( this . value !== this . #combobox. selected [ 0 ] ?. value ) {
266- this . #combobox. selected = [ ] ;
267- }
268264 }
269265
270266 #onSubmit( event : KeyboardEvent ) {
@@ -275,6 +271,11 @@ export class PfSearchInput extends LitElement {
275271
276272 #updateValue( value : string ) {
277273 this . value = value ;
274+ // it's necessary to reset the 'selected' state of combobox
275+ // since otherwise, combobox controller will attempt to prevent us from
276+ // re-selecting the last-selected item, even though pf-search-input
277+ // doesn't have a selected property
278+ this . #combobox. selected = [ ] ;
278279 }
279280
280281 #onKeyDown( event : KeyboardEvent ) {
You can’t perform that action at this time.
0 commit comments