0

I want to use the UI5 Web Component "Select" for my Site, but the dropdown doesn't open.

I'm using Lit-HTML, Typescript and Webpack. I copied the example from the Playground into my code and imported both modules (Select, StandardListItem). The exact example as well as my changed version doesn't work. But it shows the li-Element with the Attribute selected. I also use a few other UI5 Components, like Input or Datepicker, which works fine.

The Select Element:

<ui5-select class="select" id="sex">
    <ui5-li selected>Weiblich</ui5-li>
    <ui5-li>Männlich</ui5-li>
    <ui5-li>Andere</ui5-li>
</ui5-select>

And I imported:

import '@ui5/webcomponents/dist/Select';
import '@ui5/webcomponents/dist/StandardListItem';

I expected an dropdown menu, but nothing happens when I click on the little arrow or the field.

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Piratenlulatsch
  • 75
  • 1
  • 2
  • 10

1 Answers1

1

Which version of the UI5 Web components you are using? With the latest version 1.0.0-rc.2 the ui5-select expects ui5-option(s), instead of ui5-li items.

<ui5-select>
    <ui5-option icon="sap-icon://iphone">Phone</ui5-option>
    <ui5-option icon="sap-icon://ipad">Tablet</ui5-option>
    <ui5-option icon="sap-icon://laptop" selected>Desktop</ui5-option>
</ui5-select>

You can file an issue at: github.com/SAP/ui5-webcomponents/issues and perhaps you can provide a code snippet to look at.