Skip to content

Commit

Permalink
fix(ui5-list): growing button loading aligned with visual spec (SAP#9977
Browse files Browse the repository at this point in the history
)

The new visual spec mandates that when we have growing with button
there shouldn't be busy indicator overlay on top of the whole list
but a small one next to "More" text without blocking the rest of the
list.
  • Loading branch information
plamenivanov91 authored Oct 7, 2024
1 parent 4c481e6 commit f7ae10e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
8 changes: 7 additions & 1 deletion packages/main/src/List.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<ui5-busy-indicator
id="{{_id}}-busyIndicator"
delay="{{loadingDelay}}"
?active="{{loading}}"
?active="{{showBusyIndicatorOverlay}}"
class="ui5-list-busy-indicator"
>
<div class="ui5-list-scroll-container">
Expand Down Expand Up @@ -96,6 +96,12 @@
@mouseup="{{_onLoadMoreMouseup}}"
growing-button-inner
>
{{#if loading}}
<ui5-busy-indicator
delay="{{loadingDelay}}"
active>
</ui5-busy-indicator>
{{/if}}
<span id="{{_id}}-growingButton-text" growing-button-text>{{_growingButtonText}}</span>
</div>
</div>
Expand Down
4 changes: 4 additions & 0 deletions packages/main/src/List.ts
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,10 @@ class List extends UI5Element {
return this.getItems().length !== 0;
}

get showBusyIndicatorOverlay() {
return !this.growsWithButton && this.loading;
}

get showNoDataText() {
return !this.hasData && this.noDataText;
}
Expand Down
7 changes: 5 additions & 2 deletions packages/main/src/themes/GrowingButton.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
flex-direction: row;
min-height: var(--_ui5_load_more_text_height);
width: 100%;
color: var(--sapButton_TextColor);
Expand Down Expand Up @@ -46,7 +46,6 @@

[growing-button-text],
[growing-button-subtext] {
width: 100%;
text-align: center;
font-family: "72override", var(--sapFontFamily);
white-space: nowrap;
Expand All @@ -62,6 +61,10 @@
font-weight: bold;
}

:host([loading]) [growing-button-text]{
padding-left: 0.5rem;
}

[growing-button-subtext] {
font-size: var(--sapFontSize);
padding: var(--_ui5_load_more_desc_padding);
Expand Down

0 comments on commit f7ae10e

Please sign in to comment.