microsoftgraph / microsoft-graph-toolkit

Authentication Providers and UI components for Microsoft Graph 🦒
https://docs.microsoft.com/graph/toolkit/overview
Other
963 stars 309 forks source link

mgt-person data load issue-multiple renders on data change. #2027

Closed INRLDX closed 10 months ago

INRLDX commented 1 year ago

Describe the bug We are using the mgt component to load people data. In loop we are using this mgt component.The component which we are using is having event on scroll for data changes, which triggers api call to fetch next page result. However when the count of data changes, the whole UI/Component is re-loading instead of dom-update, its clearing and then loading the UI/Components on data count increase.Also the re-rendering happening twice and sometimes it increases. The impact of this behaviour is that its taking long time to render next set of results and most of the time the page freezes during rendering.

To Reproduce Steps to reproduce the behavior:

  1. use react component in template of mgt-person.
  2. We are using below in template file. pnp-persona component from pnp-modern-search (https://github.com/microsoft-search/pnp-modern-search/blob/main/search-parts/src/components/AvailableComponents.ts).
  3. Use loop to render the people data.
  4. Add event for scroll on page to trigger next set of results.

    https://github.com/microsoft-search/pnp-modern-search

Expected behavior Re-rendering of page should not happen.

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

Sample Template used

ghost commented 1 year ago

Hello INRLDX, thank you for opening an issue with us!

I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌

INRLDX commented 1 year ago

@nmetulev ,@gavinbarron - Can you please help if you have any idea about this component issue.

gavinbarron commented 1 year ago

@INRLDX for us to provide high quality support on this we're going to need a working minimal reproduction. There's a lot of set up in your steps and room for us to mis-interpret your words.

If you can share repo that has all of the behavior that you note as setup to reproduce this issue then we we'll be able to better investigate this issue.