Skip to content

Commit 2f88da0

Browse files
authoredMay 31, 2021
feat(ui5-li-custom, ui5-li, ui5-li-groupheader): add accessibleName property (#3269)
1 parent c5db8c5 commit 2f88da0

File tree

5 files changed

+39
-2
lines changed

5 files changed

+39
-2
lines changed
 

‎packages/main/src/CustomListItem.js

+12
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,18 @@ const metadata = {
2323
},
2424
},
2525
properties: /** @lends sap.ui.webcomponents.main.CustomListItem.prototype */ {
26+
/**
27+
* Defines the text alternative of the component.
28+
* Note: If not provided a default text alternative will be set, if present.
29+
*
30+
* @type {string}
31+
* @defaultvalue ""
32+
* @public
33+
* @since 1.0.0-rc.15
34+
*/
35+
accessibleName: {
36+
type: String,
37+
},
2638
},
2739
};
2840

‎packages/main/src/GroupHeaderListItem.hbs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
role="option"
88
style="list-style-type: none;"
99
>
10-
<span class="ui5-hidden-text">{{groupHeaderText}}</span>
10+
<span class="ui5-hidden-text">{{groupHeaderText}} {{accessibleName}}</span>
1111

1212
<div id="{{_id}}-content" class="ui5-li-content">
1313
<span class="ui5-ghli-title"><slot></slot></span>

‎packages/main/src/GroupHeaderListItem.js

+12
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ const metadata = {
1616
tag: "ui5-li-groupheader",
1717
languageAware: true,
1818
properties: /** @lends sap.ui.webcomponents.main.GroupHeaderListItem.prototype */ {
19+
/**
20+
* Defines the text alternative of the component.
21+
* Note: If not provided a default text alternative will be set, if present.
22+
*
23+
* @type {string}
24+
* @defaultvalue ""
25+
* @public
26+
* @since 1.0.0-rc.15
27+
*/
28+
accessibleName: {
29+
type: String,
30+
},
1931
},
2032
slots: /** @lends sap.ui.webcomponents.main.GroupHeaderListItem.prototype */ {
2133
/**

‎packages/main/src/ListItem.hbs

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
{{> selectionElement}}
4949
{{/if}}
5050

51-
<span id="{{_id}}-invisibleText" class="ui5-hidden-text">{{_accInfo.listItemAriaLabel}}</span>
51+
<span id="{{_id}}-invisibleText" class="ui5-hidden-text">{{_accInfo.listItemAriaLabel}} {{accessibleName}}</span>
5252
</li>
5353

5454
{{#*inline "listItemPreContent"}}{{/inline}}

‎packages/main/src/StandardListItem.js

+13
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,19 @@ const metadata = {
8585
defaultValue: ValueState.None,
8686
},
8787

88+
/**
89+
* Defines the text alternative of the component.
90+
* Note: If not provided a default text alternative will be set, if present.
91+
*
92+
* @type {string}
93+
* @defaultvalue ""
94+
* @public
95+
* @since 1.0.0-rc.15
96+
*/
97+
accessibleName: {
98+
type: String,
99+
},
100+
88101
/**
89102
* Indicates if the list item has text content.
90103
* @type {boolean}

0 commit comments

Comments
 (0)
Please sign in to comment.