You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(ui5-suggestion-item): add new component (#1336)
An abstract item to serve as a suggestion item within the Input. Based on the suggestion item properties, the Input will display either a StandardListItem, or a GroupHeaderListItem within the suggestion popover.
FIXES: #1313
The usage becomes:
```html
<ui5-input id="myInput2" show-suggestions >
<ui5-suggestion-item group text="group 1"></ui5-suggestion-item>
<ui5-suggestion-item text="Cozy"></ui5-suggestion-item>
<ui5-suggestion-item text="Compact"></ui5-suggestion-item>
<ui5-suggestion-item text="Condensed"></ui5-suggestion-item>
</ui5-input>
```
Although this is still compatible:
```html
<ui5-input show-suggestions >
<ui5-li>Cozy</ui5-li>
<ui5-li>Compact</ui5-li>
<ui5-li>Condensed</ui5-li>
</ui5-input>
```
* <b>Note:</b> The suggestion would be displayed only if the <code>showSuggestions</code>
62
67
* property is set to <code>true</code>.
63
68
* <br><br>
64
-
* <b>Note:</b> The <ui5-li> and <ui5-li-custom> are recommended to be used as suggestion items.
65
-
* <br>
66
-
* In order to use them, you need to import either <code>"@ui5/webcomponents/dist/StandardListItem"</code>, or <code>"@ui5/webcomponents/dist/CustomListItem"</code> module.
69
+
* <b>Note:</b> The <ui5-suggestion-item> is recommended to be used as a suggestion item.
70
+
* and you need to import the <code>"@ui5/webcomponents/dist/SuggestionItem"</code> module.
67
71
*
68
72
* @type {HTMLElement[]}
69
73
* @slot
@@ -321,6 +325,7 @@ const metadata = {
321
325
* @alias sap.ui.webcomponents.main.Input
322
326
* @extends sap.ui.webcomponents.base.UI5Element
323
327
* @tagname ui5-input
328
+
* @appenddocs SuggestionItem
324
329
* @public
325
330
*/
326
331
classInputextendsUI5Element{
@@ -547,7 +552,7 @@ class Input extends UI5Element {
547
552
}
548
553
549
554
selectSuggestion(item,keyboardUsed){
550
-
constitemText=item.textContent;
555
+
constitemText=item.text||item.textContent;// keep textContent for compatibility
0 commit comments