@@ -4,6 +4,7 @@ import ValueState from "@ui5/webcomponents-base/dist/types/ValueState.js";
4
4
import { isPhone } from "@ui5/webcomponents-base/dist/Device.js" ;
5
5
import Integer from "@ui5/webcomponents-base/dist/types/Integer.js" ;
6
6
import { getEffectiveAriaLabelText } from "@ui5/webcomponents-base/dist/util/AriaLabelHelper.js" ;
7
+ import announce from "@ui5/webcomponents-base/dist/util/InvisibleMessage.js" ;
7
8
import "@ui5/webcomponents-icons/dist/slim-arrow-down.js" ;
8
9
import "@ui5/webcomponents-icons/dist/decline.js" ;
9
10
import { getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js" ;
@@ -24,6 +25,8 @@ import {
24
25
VALUE_STATE_INFORMATION ,
25
26
INPUT_SUGGESTIONS_TITLE ,
26
27
SELECT_OPTIONS ,
28
+ LIST_ITEM_POSITION ,
29
+ LIST_ITEM_SELECTED ,
27
30
} from "./generated/i18n/i18n-defaults.js" ;
28
31
29
32
// Templates
@@ -589,6 +592,10 @@ class ComboBox extends UI5Element {
589
592
indexOfItem += isArrowDown ? 1 : - 1 ;
590
593
indexOfItem = indexOfItem < 0 ? 0 : indexOfItem ;
591
594
595
+ if ( this . responsivePopover . opened ) {
596
+ this . announceSelectedItem ( indexOfItem ) ;
597
+ }
598
+
592
599
this . _filteredItems [ indexOfItem ] . focused = true ;
593
600
this . filterValue = this . _filteredItems [ indexOfItem ] . text ;
594
601
this . _isKeyNavigation = true ;
@@ -721,6 +728,13 @@ class ComboBox extends UI5Element {
721
728
this . _itemFocused = true ;
722
729
}
723
730
731
+ announceSelectedItem ( indexOfItem ) {
732
+ const itemPositionText = this . i18nBundle . getText ( LIST_ITEM_POSITION , [ indexOfItem + 1 ] , [ this . _filteredItems . length ] ) ;
733
+ const itemSelectionText = this . i18nBundle . getText ( LIST_ITEM_SELECTED ) ;
734
+
735
+ announce ( `${ itemPositionText } ${ itemSelectionText } ` , "Polite" ) ;
736
+ }
737
+
724
738
get _headerTitleText ( ) {
725
739
return this . i18nBundle . getText ( INPUT_SUGGESTIONS_TITLE ) ;
726
740
}
0 commit comments