-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix columns #542
Fix columns #542
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was wrong? From a distant perspective, it looks like the logic in useColumns is correct but we had a regression in the state logic, hence the current fix is only hiding it, without going after the root issue.
Well it makes sense to call it on resize as columns look at the size of the grid, and the container state is changed according to the total column size... |
I'm merging this one as it's blocking all the other PRs, we can open an issue or investigate separately. |
… |
This reverts commit 983d7aa.
const onResize = React.useCallback( | ||
(size) => { | ||
resetColumns(size.width); | ||
}, | ||
[resetColumns], | ||
); | ||
useApiEventHandler(apiRef, RESIZE, onResize); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I understand gridState.containerSizes?.viewportSize.width
already depends on the resize event, so this whole block is duplicated logic.
* refactor columns * Fix columns test * remove dependency on viewport * fix test, reverted last commit
This reverts commit 983d7aa.
No description provided.