OfficeDev / microsoft-teams-ui-component-library

Component library enhanced experiences styled for use in Microsoft Teams custom applications.
MIT License
127 stars 30 forks source link

List component Data Refresh #75

Closed LeandroMendesDS closed 2 years ago

LeandroMendesDS commented 3 years ago

Reproduction/Problem

I'm trying to implement my own pagination system with the existing List component. My idea was to able to change the page and be able to fill the data from the database so I don't overload the client-side.
However, I'm now facing a problem... whenever I have an item on a page selected and change to the next page or update data variable. Ex: If on page 1 or dataset 1 I selected 10 elements if I change to the next page/ dataset and it only has 9 elements I get an error.

This seems to be the table trying to fill that index that no longer exists. My question now is can I clean the selected elements in any way to avoid this problem? I don't seem to find any way to programmatically unselect these list checkboxes.

Actual Behavior

The error message: 1.Cannot read property 'actions' of undefined.

  1. Sometimes just an empty blank reloaded tab inside teams

This error appears every time I try to manually change the data by updating the row variable I pass to the list. Also passing an empty array/empty data after having selected data previously shows the same issue...

thure commented 3 years ago

Hi @LeandroMendesDS, thanks for reaching out about this.

Actually we were planning on implementing first-party pagination support soon. If your need is not urgent, you may find pagination support in a release in the near future.

Could you share a CodeSandbox with the configuration that's causing this issue, or could you share the props you’re giving List for each page of content you’re trying to render?