When ResourceList is loading it does not show the spinner if it is also empty. I'm not sure if this is the intended behaviour. I find it counterintuitive because on page load I will never have any items to display and loading will be true as they are fetched from the server.
I also found #426 but it does not seem to be fixed for me in 2.10.0
When using the resource list I expect to see a loading spinner when my items={[]} and loading=true.
When using the resource list I see an empty page banner when my items={[]} and loading=true.
[]trueOr just look at where it is in the code below
Note that emptyMarkup does not contain the loadingOverlay
⚓️ We’re not accepting pull requests at this time
🗒 We _are_ accepting issue reports and feature requests
🌟 Feature requests that we can’t get to right away will be closed. However, we track all requests and will use it to set priorities. See the contribution guidelines for more information.
Thank you for the issue @qw-in. We have an internal issue opened for discussion about how to handle loading with no items. I will update this when we've implemented a solution.
im having a similar problem related to this issue. if the items array has nothing inside when initialized, bulk action buttons do not appear even tho later on when the api received items to the array.
<ResourceList
showHeader={true}
resourceName={resourceName}
items={this.props.items}
renderItem={this.renderItem}
selectedItems={this.state.selectedItems}
onSelectionChange={this.handleSelectionChange}
promotedBulkActions={promotedBulkActions}
/>
@wuichen Bulk actions are intended to be disabled when items are loading to prevent attempts at selecting an action that has no items to perform on.
@solonaarmstrong i understand that part. but when the items prop received items from api(has greater length than 0), the action buttons are still disabled.
Oh, I see. I apologize, I misunderstood. I will have a look.
This is fixed in our next release, which should be sometime next week.
CHANGELOG.md
Removed empty state from ResourceList if there are no items and loading is true
Thanks @solonaarmstrong @dleroux! New release is great so far :smile:
Wonderful!
Most helpful comment
CHANGELOG.mdThanks @solonaarmstrong @dleroux! New release is great so far :smile: