File tree 2 files changed +16
-0
lines changed
2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -323,6 +323,7 @@ class ComboBox extends UI5Element {
323
323
324
324
this . _filteredItems = [ ] ;
325
325
this . _initialRendering = true ;
326
+ this . _itemFocused = false ;
326
327
this . i18nBundle = getI18nBundle ( "@ui5/webcomponents" ) ;
327
328
}
328
329
@@ -356,6 +357,16 @@ class ComboBox extends UI5Element {
356
357
// Set initial focus to the native input
357
358
this . inner . focus ( ) ;
358
359
}
360
+
361
+ if ( this . shouldClosePopover ( ) ) {
362
+ this . responsivePopover . close ( false , false , true ) ;
363
+ }
364
+
365
+ this . _itemFocused = false ;
366
+ }
367
+
368
+ shouldClosePopover ( ) {
369
+ return this . responsivePopover . opened && ! this . focused && ! this . _itemFocused ;
359
370
}
360
371
361
372
_focusin ( event ) {
@@ -508,6 +519,10 @@ class ComboBox extends UI5Element {
508
519
this . _inputChange ( ) ;
509
520
}
510
521
522
+ _onItemFocus ( event ) {
523
+ this . _itemFocused = true ;
524
+ }
525
+
511
526
get _headerTitleText ( ) {
512
527
return this . i18nBundle . getText ( INPUT_SUGGESTIONS_TITLE ) ;
513
528
}
Original file line number Diff line number Diff line change 49
49
<ui5-list
50
50
separators =" None"
51
51
@ui5-item-click ={{ _selectItem }}
52
+ @ui5-item-focused ={{ _onItemFocus }}
52
53
mode =" SingleSelect"
53
54
>
54
55
{{ #each _filteredItems }}
You can’t perform that action at this time.
0 commit comments