Skip to content

Commit 6e4a156

Browse files
authoredDec 17, 2020
feat(ui5-mcb-item): implement stable-dom-ref property (#2418)
1 parent 9661ab8 commit 6e4a156

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed
 

‎packages/main/src/MultiComboBox.js

+6
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,12 @@ const metadata = {
338338
* <li> Backspace - deletes the token and focus the next token. </li>
339339
* </ul>
340340
*
341+
* In the context of <code>ui5-multi-combobox</code>, you can provide a custom stable DOM ref for:
342+
* <ul>
343+
* <li>Every <code>ui5-mcb-item</code> that you provide.
344+
* Example: <code><ui5-mcb-item stable-dom-ref="item1"></ui5-mcb-item></code></li>
345+
* </ul>
346+
*
341347
* <h3>ES6 Module Import</h3>
342348
*
343349
* <code>import "@ui5/webcomponents/dist/MultiComboBox";</code>

‎packages/main/src/MultiComboBoxItem.js

+9
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ const metadata = {
1313
* @public
1414
*/
1515
selected: { type: Boolean },
16+
17+
/**
18+
* Defines the stable selector that you can use via getStableDomRef method.
19+
* @public
20+
* @since 1.0.0-rc.10
21+
*/
22+
stableDomRef: {
23+
type: String,
24+
},
1625
},
1726
};
1827

‎packages/main/src/MultiComboBoxPopover.hbs

+8-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,14 @@
6767

6868
<ui5-list separators="None" mode="MultiSelect" class="ui5-multi-combobox-all-items-list">
6969
{{#each _filteredItems}}
70-
<ui5-li type="{{../_listItemsType}}" ?selected={{this.selected}} data-ui5-token-id="{{this._id}}">{{this.text}}</ui5-li>
70+
<ui5-li
71+
type="{{../_listItemsType}}"
72+
?selected={{this.selected}}
73+
data-ui5-token-id="{{this._id}}"
74+
data-ui5-stable="{{this.stableDomRef}}"
75+
>
76+
{{this.text}}
77+
</ui5-li>
7178
{{/each}}
7279
</ui5-list>
7380

0 commit comments

Comments
 (0)
Please sign in to comment.