Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui5-list): improved loading state #9520

Merged
merged 4 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 7 additions & 13 deletions packages/main/src/List.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
@ui5-_selection-requested={{onSelectionRequested}}
@ui5-_focus-requested={{onFocusRequested}}
>
<ui5-busy-indicator
id="{{_id}}-busyIndicator"
delay="{{loadingDelay}}"
?active="{{loading}}"
class="ui5-list-busy-indicator"
>
<div class="ui5-list-scroll-container">
{{! header}}
{{#if header.length}}
Expand Down Expand Up @@ -66,23 +72,11 @@

<span tabindex="-1" aria-hidden="true" class="ui5-list-end-marker"></span>
</div>

{{#if loading}}
<div class="ui5-list-loading-row">
<ui5-busy-indicator
delay="{{loadingDelay}}"
active
class="ui5-list-loading-ind"
style="{{styles.loadingInd}}"
data-sap-focus-ref
></ui5-busy-indicator>
</div>
{{/if}}

<ui5-drop-indicator
orientation="Horizontal"
.ownerReference="{{this}}"
></ui5-drop-indicator>
</ui5-busy-indicator>
</div>


Expand Down
16 changes: 0 additions & 16 deletions packages/main/src/List.ts
Original file line number Diff line number Diff line change
Expand Up @@ -715,22 +715,6 @@ class List extends UI5Element {
return this.growingButtonText || List.i18nBundle.getText(LOAD_MORE_TEXT);
}

get loadingIndPosition() {
if (!this.grows) {
return "absolute";
}

return this._inViewport ? "absolute" : "sticky";
}

get styles() {
return {
loadingInd: {
position: this.loadingIndPosition,
},
};
}

get listAccessibleRole() {
return this.accessibleRole.toLowerCase();
}
Expand Down
25 changes: 3 additions & 22 deletions packages/main/src/themes/List.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,8 @@
border-bottom: 0;
}

:host([loading]) {
opacity: 0.72;
}

:host([loading]) .ui5-list-loading-row {
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
outline: none;
}

:host([loading]) .ui5-list-loading-ind {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 1;
}

.ui5-list-root {
.ui5-list-root,
.ui5-list-busy-indicator {
width: 100%;
height: 100%;
position: relative;
Expand All @@ -47,6 +27,7 @@
.ui5-list-scroll-container {
overflow: auto;
height: 100%;
width: 100%;
}

.ui5-list-ul {
Expand Down