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
Click the "go back" button quickly after the scroll (in real environment, clicking the back button to navigate to the previous location works the same)
Actual behavior
Exception is thrown: TypeError: Cannot read property 'offsetWidth' of null
bp.table.mp4
Expected behavior
No exception
Possible solution
The scroll event handler should check if the table is still mounted
The text was updated successfully, but these errors were encountered:
Add an unmount handler to your component where you'd manually clear debouncedViewSyncInterval. Clearing this interval fixes the issue:
useEffect(() => {
// ensure any scheduled handlers are canceled on unmount
return () => {
if (tableRef.current) {
// dispite quadrantStackInstance being a private member of quadrantStackInstance we still can access it
const tableQuadrantStackInstance = (tableRef.current as any).quadrantStackInstance;
clearInterval(tableQuadrantStackInstance?.debouncedViewSyncInterval);
// also added these 2 `clearTimeouts` calls below (they don't help with original issue though), as it still feels right to call them on unmount
tableQuadrantStackInstance?.clearTimeouts();
tableRef.current.clearTimeouts();
}
};
}, []);
@N1kto we have some share component infra for dealing with canceling timeouts on unmount. I've gone ahead and used that here in #5124. That should fix the issue, but beware that it will break your workaround because of a private member rename.
Environment
Code Sandbox
Link to a minimal repro (fork this code sandbox): https://codesandbox.io/s/blueprint-sandbox-forked-iuzkh
Steps to reproduce
Actual behavior
Exception is thrown: TypeError: Cannot read property 'offsetWidth' of null
bp.table.mp4
Expected behavior
No exception
Possible solution
The scroll event handler should check if the table is still mounted
The text was updated successfully, but these errors were encountered: