File tree 3 files changed +37
-2
lines changed
3 files changed +37
-2
lines changed Original file line number Diff line number Diff line change 22
22
aria-haspopup =" listbox"
23
23
aria-autocomplete =" both"
24
24
aria-describedby =" {{ valueStateTextId }} "
25
+ aria-label =" {{ ariaLabelText }} "
25
26
/>
26
27
27
28
{{ #unless readonly }}
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
2
2
import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js" ;
3
3
import ValueState from "@ui5/webcomponents-base/dist/types/ValueState.js" ;
4
4
import { isPhone } from "@ui5/webcomponents-base/dist/Device.js" ;
5
+ import getEffectiveAriaLabelText from "@ui5/webcomponents-base/dist/util/getEffectiveAriaLabelText.js" ;
5
6
import "@ui5/webcomponents-icons/dist/icons/slim-arrow-down.js" ;
6
7
import "@ui5/webcomponents-icons/dist/icons/decline.js" ;
7
8
import { getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js" ;
@@ -173,6 +174,30 @@ const metadata = {
173
174
type : Boolean ,
174
175
} ,
175
176
177
+ /**
178
+ * Defines the aria-label attribute for the combo box
179
+ * @type {String }
180
+ * @defaultvalue : ""
181
+ * @private
182
+ * @since 1.0.0-rc.8
183
+ */
184
+ ariaLabel : {
185
+ type : String ,
186
+ defaultValue : undefined ,
187
+ } ,
188
+
189
+ /**
190
+ * Receives id(or many ids) of the elements that label the combo box
191
+ * @type {String }
192
+ * @defaultvalue ""
193
+ * @private
194
+ * @since 1.0.0-rc.8
195
+ */
196
+ ariaLabelledby : {
197
+ type : String ,
198
+ defaultValue : "" ,
199
+ } ,
200
+
176
201
_iconPressed : {
177
202
type : Boolean ,
178
203
noAttribute : true ,
@@ -519,6 +544,14 @@ class ComboBox extends UI5Element {
519
544
} ;
520
545
}
521
546
547
+ get open ( ) {
548
+ return this . responsivePopover ? this . responsivePopover . opened : false ;
549
+ }
550
+
551
+ get ariaLabelText ( ) {
552
+ return getEffectiveAriaLabelText ( this ) ;
553
+ }
554
+
522
555
static async onDefine ( ) {
523
556
await Promise . all ( [
524
557
ComboBoxItem . define ( ) ,
Original file line number Diff line number Diff line change 40
40
</ style >
41
41
42
42
< div class ="demo-section ">
43
- < ui5-combobox id ="combo " style ="width: 360px; " value ="Bulgaria ">
43
+ < ui5-label id ="countryLabel "> Select country: </ ui5-label >
44
+ < ui5-combobox id ="combo " style ="width: 360px; " value ="Bulgaria " aria-labelledby ="countryLabel ">
44
45
< ui5-cb-item text ="Algeria "> </ ui5-cb-item >
45
46
< ui5-cb-item text ="Argentina "> </ ui5-cb-item >
46
47
< ui5-cb-item text ="Australia "> </ ui5-cb-item >
54
55
< ui5-cb-item text ="Chile "> </ ui5-cb-item >
55
56
</ ui5-combobox >
56
57
57
- < ui5-combobox id ="combo2 " style ="width: 360px; ">
58
+ < ui5-combobox id ="combo2 " style ="width: 360px; " aria-label =" Select destination: " >
58
59
< ui5-cb-item text ="Algeria "> </ ui5-cb-item >
59
60
< ui5-cb-item text ="Argentina "> </ ui5-cb-item >
60
61
< ui5-cb-item text ="Australia "> </ ui5-cb-item >
You can’t perform that action at this time.
0 commit comments