You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When scrolling through the DetailsList in the provided sample, you'll notice that the list fails to load in subsequent pages of results, even with the scrollable container being defined.
After some investigation, I've found that the issue happens when the component re-mounts (a result of React.StrictMode).
The bug is a result of how the event group is being disposed on unmount, but not being re-initialized on remount (it is only initialized in the constructor). When the component re-mounts, the component tries to register the events again, but because the event group had been disposed, none of them get processed (including the necessary "scroll" events).
Library
React / v8 (@fluentui/react)
System Info
Are you reporting Accessibility issue?
None
Reproduction
https://codesandbox.io/s/red-lake-c7b419?file=/src/App.tsx
Bug Description
Actual Behavior
When scrolling through the DetailsList in the provided sample, you'll notice that the list fails to load in subsequent pages of results, even with the scrollable container being defined.
After some investigation, I've found that the issue happens when the component re-mounts (a result of React.StrictMode).
The bug is a result of how the event group is being disposed on unmount, but not being re-initialized on remount (it is only initialized in the constructor). When the component re-mounts, the component tries to register the events again, but because the event group had been disposed, none of them get processed (including the necessary "scroll" events).
The fix is likely to move initialization of the event group from the constructor into componentDidMount, with the other event registration methods.
Expected Behavior
The DetailsList is able to virtualize properly on scroll after a re-mount.
Logs
No response
Requested priority
High
Products/sites affected
No response
Are you willing to submit a PR to fix?
yes
Validations
The text was updated successfully, but these errors were encountered: