Skip to content

Dataviews - isLoading property is ignored when data property is populated #64360

@Zealth57

Description

@Zealth57

Not sure if this is considered a bug or a feature. In dataviews, when you pass the isLoading property, it outputs a loading circle process. If you pass isLoading={true} AND you pass an array of data to the data={} property, then the isLoading is ignored and it shows data. I think the isLoading property should take precedence over there being data. Consider for example if I have a table of data visible. I give the user a way to manipulate the data in this table via a modal form. After the form is submitted, I want to fetch fresh data into the data from an external fetch call. In my component I would set isLoading to true, but I wouldn't wipe away the data. If I wipe the data AND set isLoading to true, it will cause multiple unnecessary renders of the whole component. I would simply set isLoading to true, and update the data with fresh data once the fetch call completes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] DataViewsWork surrounding upgrading and evolving views in the site editor and beyond[Package] DataViews/packages/dataviews[Type] EnhancementA suggestion for improvement.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions