ui5-webcomponents icon indicating copy to clipboard operation
ui5-webcomponents copied to clipboard

refactor(ui5-option): make options physical elements

Open dobrinyonkov opened this issue 1 year ago • 0 comments

Removes the ui5-select-menu and ui5-select-menu-option components.

BREAKING CHANGE: The ui5-select-menu and ui5-select-menu-option components are removed. Custom options can now be created using the ui5-option-custom, directly placed inside the default slot of the ui5-select

SelectMenu & SelectMenuOption

Changed item Old New
SelectMenu ui5-select-menu removed
SelectMenuOption ui5-select-menu-option ui5-option-custom

If you have previously used the ui5-select-menu and ui5-select-menu-option:

<ui5-select menu="selectMenu"></ui5-select>

<ui5-select-menu id="selectMenu">
    <ui5-select-menu-option>
        <div class="optionContent">custom</div>
    </ui5-select-menu-option>
</ui5-select-menu>

Now use just ui5-select and ui5-option-custom instead:

<ui5-select>
    <ui5-option-custom>
        <div class="optionContent">custom</div>
    </ui5-option-custom>
</ui5-select>

Select

Changed item Old New
property menu removed

The menu property of the ui5-select is removed.

Option

Changed item Old New
slot text content

The ui5-option default slot's accessor text is renamed to content.

If you have previously used it like:

const text = selectOption.text;

Now use the content getter:

const text = selectOption.content;

Related to https://github.com/SAP/ui5-webcomponents/issues/8461, https://github.com/SAP/ui5-webcomponents/issues/7887

dobrinyonkov avatar May 07 '24 09:05 dobrinyonkov