lwc icon indicating copy to clipboard operation
lwc copied to clipboard

lightning-datatable | Loading indicator hardly visible

Open bastiW opened this issue 4 years ago • 9 comments

Hi,

the loading indicator in the lightning datatable is hardly visible.

image

How to reproduce: go to https://developer.salesforce.com/docs/component-library/bundle/lightning-datatable/example Copy paste the following code into HTML:

<template>
     <div style="height: 600px;">
        <lightning-datatable
                is-loading="true"
                key-field="id"
                columns={columns}>
        </lightning-datatable>
    </div>    
</template>

bastiW avatar Nov 09 '20 16:11 bastiW

This issue has been linked to a new work item: W-8376866

git2gus[bot] avatar Nov 10 '20 10:11 git2gus[bot]

I am actually talking about the lightning-datatable not the lightning-tree-grid. Sorry for confusion. I updated the bug description.

bastiW avatar Dec 08 '20 14:12 bastiW

lightning-datatablei too less height This also affects any other compents where you wish to have more height inside the component.

I can not change the CSS as this is part of the LWC.

bastiW avatar Dec 08 '20 14:12 bastiW

Hi,

the loading indicator in the lightning datatable is hardly visible.

image

How to reproduce: go to https://developer.salesforce.com/docs/component-library/bundle/lightning-datatable/example Copy paste the following code into HTML:

<template>
     <div style="height: 600px;">
        <lightning-datatable
                is-loading="true"
                key-field="id"
                columns={columns}>
        </lightning-datatable>
    </div>    
</template>

Depending on your situation, a better CSS option might be min-height instead of height. That way you get the amount of height needed to show the spinner, but once the data loads, you're not restricting the height of the table (unless you want to, which may be the case). So you would simply change it to:

<template>
     <div style="min-height: 200px;">
        <lightning-datatable
                is-loading="true"
                key-field="id"
                columns={columns}>
        </lightning-datatable>
    </div>
</template>

joelbyrd avatar Jul 20 '21 15:07 joelbyrd

Is there a work around for this? Wrapping my lightning-tree-grid component with a div with min-height does not show the spinner

joeythomaschaske avatar May 29 '22 01:05 joeythomaschaske

If you set the tbody height to 40px as a workaround you will be able to see the full spinner.

Shibichakku avatar Aug 31 '22 14:08 Shibichakku

@Shibichakku How do you affect the styling of a component internal to the lwc? It's not accessible due to shadow dom and CSS namespacing.

jclark-dot-org avatar Oct 04 '22 19:10 jclark-dot-org

@jclark-dot-org , Not the ideal way. But if I need the override badly, will keep it in a stylesheet static resource and load it separately to get those css applied. Again, this is just a workaround and would be good if the change can be done in the standard css itself.

Shibichakku avatar Oct 04 '22 19:10 Shibichakku

Still can't use the default loading spinner on lwc datatable, it's partly cut off at the bottom of the table. Any idea when this is likely to be fixed?

HyruleConsulting avatar Feb 05 '24 21:02 HyruleConsulting