diff --git a/packages/main/src/List.hbs b/packages/main/src/List.hbs index 22163f1d73b2..ea9daa0d85e6 100644 --- a/packages/main/src/List.hbs +++ b/packages/main/src/List.hbs @@ -2,53 +2,52 @@ class="ui5-list-root" @focusin="{{_onfocusin}}" @keydown="{{_onkeydown}}" - @scroll="{{_onScroll}}" > - - {{#if header.length}} - - {{/if}} - {{#if shouldRenderH1}} -
- {{headerText}} -
- {{/if}} +
+ + {{#if header.length}} + + {{/if}} + {{#if shouldRenderH1}} +
+ {{headerText}} +
+ {{/if}} + + {{#if hasData}} +
+ {{/if}} - {{#if hasData}} -
- {{/if}} +
    + -
      - + {{#if showNoDataText}} +
    • +
      + {{noDataText}} +
      +
    • + {{/if}} +
    - {{#if showNoDataText}} -
  • -
    - {{noDataText}} -
    -
  • + {{#if footerText}} +
    + {{footerText}} +
    {{/if}} -
- - {{#if footerText}} -
- {{footerText}} -
- {{/if}} - {{#if showBusy}} -
- -
- {{/if}} + {{#if hasData}} +
+ {{/if}} +
- {{#if hasData}} -
- {{/if}} +
+ +
diff --git a/packages/main/src/List.js b/packages/main/src/List.js index f051e5843427..e0908586dbf1 100644 --- a/packages/main/src/List.js +++ b/packages/main/src/List.js @@ -15,7 +15,6 @@ import ListTemplate from "./generated/templates/ListTemplate.lit.js"; // Styles import listCss from "./generated/themes/List.css.js"; -const BUSYINDICATOR_HEIGHT = 48; // px const INFINITE_SCROLL_DEBOUNCE_RATE = 250; // ms /** @@ -389,10 +388,6 @@ class List extends UI5Element { return !this.hasData && this.noDataText; } - get showBusy() { - return this.busy || this.infiniteScroll; - } - get isMultiSelect() { return this.mode === ListMode.MultiSelect; } @@ -763,7 +758,7 @@ class List extends UI5Element { } this.previousScrollPosition = scrollTop; - if (scrollHeight - BUSYINDICATOR_HEIGHT <= height + scrollTop) { + if (scrollHeight <= height + scrollTop) { this.fireEvent("load-more"); } } diff --git a/packages/main/src/themes/List.css b/packages/main/src/themes/List.css index ad3dd1f41233..e7fa5b1808a6 100644 --- a/packages/main/src/themes/List.css +++ b/packages/main/src/themes/List.css @@ -12,12 +12,26 @@ border-bottom: 0; } +:host([busy]) { + opacity: 0.72; +} + +:host([busy]) .ui5-list-busy-row { + position: absolute; + top: 50%; + left: 50%; +} + .ui5-list-root { width: 100%; height: 100%; position: relative; box-sizing: border-box; +} + +.ui5-list-scroll-container { overflow: auto; + height: 100%; } .ui5-list-ul { @@ -84,11 +98,4 @@ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; -} - -.ui5-list-busy-row { - display: flex; - align-items: center; - height: var(--_ui5_list_busy_row_height); - justify-content: center; -} +} \ No newline at end of file diff --git a/packages/main/test/pages/List.html b/packages/main/test/pages/List.html index 297810c0be1e..2064721e7cae 100644 --- a/packages/main/test/pages/List.html +++ b/packages/main/test/pages/List.html @@ -383,7 +383,8 @@

Items 3/3

var itemsLoadedTotal = 0; var itemsToLoad = 5; var loadedCount = 0; - infiniteScrollEx.addEventListener("loadMore", function(e) { + + infiniteScrollEx.addEventListener("ui5-load-more", function(e) { var el = infiniteScrollEx; el.busy = true; @@ -391,7 +392,7 @@

Items 3/3

insertItems(el, 3); el.busy = false; result.textContent = (++loadedCount) + " times " + (itemsLoadedTotal += itemsToLoad); - }, 200); + }, 1000); }); diff --git a/packages/main/test/pages/List_test_page.html b/packages/main/test/pages/List_test_page.html index 752877682ae3..580cb7db983a 100644 --- a/packages/main/test/pages/List_test_page.html +++ b/packages/main/test/pages/List_test_page.html @@ -222,7 +222,7 @@

Test aria

}) btnTrigger.addEventListener("click", function(e) { - var scrollableContiner = infiniteScrollEx.shadowRoot.querySelector(".ui5-list-root"); + var scrollableContiner = infiniteScrollEx.shadowRoot.querySelector(".ui5-list-scroll-container"); scrollableContiner.scroll(0, scrollableContiner.scrollHeight); });