Skip to content

Commit

Permalink
Merge pull request #56 from SFDO-Community/feature/dec05-expand-JS-lo…
Browse files Browse the repository at this point in the history
…ader-logic-for-apex-metadata

Update JS loader icon based on Apex and records load completion
  • Loading branch information
pickettd authored Dec 5, 2024
2 parents bec074a + 89efe3c commit d3f49c8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
class="slds-float_left slds-var-m-top_xx-small slds-var-p-around_x-small slds-scrollable_y grid-main"
>
<!-- Spinner -->
<template if:true={isLoading}>
<template if:true={stillShowLoading}>
<div class="slds-var-p-around_x-large spinner">
<lightning-spinner
alternative-text="Loading"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ export default class StickySelectronMain extends LightningElement {
@api initialListCount;
isLoading = false;

// We want to continue showing the loading icon if our LWC hasn't rendered yet,
// if the input list is empty, or if the input table field metadata hasn't finished yet
// Note that we compare the inputTableFieldNames length to the fieldsOnLeft length - 1 because of the Select column that is in the fieldsOnLeft but
// not in the inputTableFieldNames
get stillShowLoading() {
return (
this.isLoading ||
this.workingInputObjList.length === 0 ||
this.inputTableFieldNames.length !== this.fieldsOnLeft.length - 1
);
}

@api inputTableFieldNames;
@api selectedTableFieldNames;

Expand Down

0 comments on commit d3f49c8

Please sign in to comment.