diff --git a/packages/main/src/List.ts b/packages/main/src/List.ts index 3609908e1132..ef21230ded5c 100644 --- a/packages/main/src/List.ts +++ b/packages/main/src/List.ts @@ -676,6 +676,10 @@ class List extends UI5Element { return ids.length ? ids.join(" ") : undefined; } + get noDataAriaLabelledBy() { + return `${this._id}-nodata-text`; + } + get ariaLabelTxt() { return this._associatedLabelsRefTexts || getEffectiveAriaLabelText(this); } diff --git a/packages/main/src/ListTemplate.tsx b/packages/main/src/ListTemplate.tsx index ca0a995ad297..2375f228321f 100644 --- a/packages/main/src/ListTemplate.tsx +++ b/packages/main/src/ListTemplate.tsx @@ -54,7 +54,7 @@ export default function ListTemplate(this: List) { {this.showNoDataText && -
  • +
  • {this.noDataText}
    diff --git a/packages/main/src/themes/List.css b/packages/main/src/themes/List.css index 9689cfcf97d3..522438a7c99b 100644 --- a/packages/main/src/themes/List.css +++ b/packages/main/src/themes/List.css @@ -98,7 +98,12 @@ position: absolute; inset: 0.125rem; pointer-events: none; - top: calc(50% + 0.125rem); + top: 50%; +} + +:host([header-text=""]) .ui5-list-nodata:focus::after, +:host(:not([header-text])) .ui5-list-nodata:focus::after { + top: 0.125rem; } .ui5-list-nodata-text {