Skip to content

ui5-search: expose inner ui5-select (scope dropdown) via CSS ::part() to allow host styling #13719

Description

@Sobyt483

Summary

<ui5-search> renders an inner <ui5-select> for the scope dropdown, but the element is not exposed as a CSS part. This makes it impossible to style the scope select from outside the component using the standard ::part() mechanism.

Current behaviour

The scope select is hard-coded with max-width: 10rem (160 px) inside the <ui5-search> shadow root:

/* inside ui5-search shadow root — adoptedStyleSheets */
[ui5-select] {
  max-width: 10rem;
  ...
}

Additionally, .ui5-select-label-root inside the <ui5-select> shadow root has overflow: hidden; text-overflow: ellipsis, so any label text longer than ~160 px is truncated with no way to override it through the public API.

Expected behaviour

  1. <ui5-select> inside <ui5-search> is exposed as a named CSS part (e.g. part="scope-select"), allowing host applications to write:
ui5-search::part(scope-select) {
  max-width: none;
  min-width: fit-content;
}

Workaround

Currently the only reliable workaround is imperative DOM patching through nested shadow roots at runtime, which is fragile and breaks encapsulation:

const ui5Select = ui5Search.shadowRoot?.querySelector('ui5-select') as HTMLElement;
ui5Select.style.maxWidth = 'none';
ui5Select.style.minWidth = 'fit-content';

const label = ui5Select.shadowRoot?.querySelector('.ui5-select-label-root') as HTMLElement;
label.style.overflow = 'visible';
label.style.textOverflow = 'clip';

Use case

Scope labels such as "My Contributions" or any other localised string longer than ~11 characters are visually truncated even when there is ample space available in the toolbar. This is a real UX regression for applications that use <ui5-search> with named scopes.

Environment

  • @ui5/webcomponents-fiori version: 2.22.0
  • Browser: Chrome 149

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions