Skip to content

Commit 2f67084

Browse files
authored
feat(ui5-li): title attribute handle (#3385)
1 parent fd60e90 commit 2f67084

File tree

5 files changed

+27
-3
lines changed

5 files changed

+27
-3
lines changed

packages/main/src/ListItem.hbs

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
aria-selected="{{ariaSelected}}"
1515
role="{{_accInfo.role}}"
1616
aria-expanded="{{_accInfo.ariaExpanded}}"
17+
title="{{title}}"
1718
aria-level="{{_accInfo.ariaLevel}}"
1819
aria-posinset="{{_accInfo.posinset}}"
1920
aria-setsize="{{_accInfo.setsize}}"

packages/main/src/ListItem.js

+11
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,17 @@ const metadata = {
4646
type: Boolean,
4747
},
4848

49+
/**
50+
* Defines the tooltip of the component.
51+
* @type {string}
52+
* @defaultvalue ""
53+
* @private
54+
* @since 1.0.0-rc.15
55+
*/
56+
title: {
57+
type: String,
58+
},
59+
4960
/**
5061
* Indicates if the list item is actionable, e.g has hover and pressed effects.
5162
*

packages/main/src/SuggestionListItem.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const metadata = {
2121
type: HTMLElement,
2222
},
2323
"default": {
24-
propertyName: "title",
24+
propertyName: "titleText",
2525
},
2626
},
2727
};
@@ -59,11 +59,11 @@ class SuggestionListItem extends StandardListItem {
5959

6060
onBeforeRendering(...params) {
6161
super.onBeforeRendering(...params);
62-
this.hasTitle = !!this.title.length;
62+
this.hasTitle = !!this.titleText.length;
6363
}
6464

6565
get effectiveTitle() {
66-
return this.title.filter(node => node.nodeType !== Node.COMMENT_NODE).map(el => el.textContent).join("");
66+
return this.titleText.filter(node => node.nodeType !== Node.COMMENT_NODE).map(el => el.textContent).join("");
6767
}
6868

6969
get hasDescription() {

packages/main/src/Tree.hbs

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
icon="{{this.treeItem.icon}}"
1818
additional-text="{{this.treeItem.additionalText}}"
1919
additional-text-state="{{this.treeItem.additionalTextState}}"
20+
title="{{this.treeItem.title}}"
2021
?_toggle-button-end="{{ ../_toggleButtonEnd}}"
2122
?_minimal="{{../_minimal}}"
2223
.treeItem="{{this.treeItem}}"

packages/main/src/TreeItem.js

+11
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,17 @@ const metadata = {
9191
type: ValueState,
9292
defaultValue: ValueState.None,
9393
},
94+
95+
/**
96+
* Defines the tooltip of the component.
97+
* @type {string}
98+
* @defaultvalue ""
99+
* @private
100+
* @since 1.0.0-rc.15
101+
*/
102+
title: {
103+
type: String,
104+
},
94105
},
95106
managedSlots: true,
96107
slots: /** @lends sap.ui.webcomponents.main.TreeItem.prototype */ {

0 commit comments

Comments
 (0)