Skip to content
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

Cols update doesn't reflect changes in version 0.17.1 #1083

Closed
minotogna opened this issue Nov 20, 2019 · 3 comments
Closed

Cols update doesn't reflect changes in version 0.17.1 #1083

minotogna opened this issue Nov 20, 2019 · 3 comments
Labels
stale The label to apply when a pull request or an issue is stale

Comments

@minotogna
Copy link

Hello,

I noticed that in version 0.17.1 if cols is dynamically update, the grid doesn't reflect the change.
It used to work in version 0.16.6.

I have create a test case here:
https://codepen.io/drusus-uttarayananda-minor/pen/KKKEKvY

Thank you.
Mino

gregbty added a commit to AchieveIt/react-grid-layout that referenced this issue Nov 27, 2019
The width change event was ignoring dynamic changes to breakpoints and
columns because it was checking current props against itself. This bug was
introduced when the library refactored the use of the deprecated
componentWillRecieveProps in favor of componentDidUpdate.

Fixes react-grid-layout#1083
@lebbe
Copy link

lebbe commented Dec 5, 2019

I also experience this problem, updating cols doesn't update the GridLayout.

@lebbe
Copy link

lebbe commented Dec 5, 2019

I found kind of like a workaround. We don't need the moved flag in the layout, so I just flip this boolean every time cols is updated, and the grid is redrawn with the new cols.

const [a, ...rest] = this.state.layout;
this.setState({
	layout: [{...a, moved: !a.moved}, ...rest],
	cols: cols
});

@github-actions
Copy link

github-actions bot commented Jan 4, 2020

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 7 days

@github-actions github-actions bot added the stale The label to apply when a pull request or an issue is stale label Jan 4, 2020
STRML pushed a commit that referenced this issue Jan 13, 2020
The width change event was ignoring dynamic changes to breakpoints and
columns because it was checking current props against itself. This bug was
introduced when the library refactored the use of the deprecated
componentWillRecieveProps in favor of componentDidUpdate.

Fixes #1083
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale The label to apply when a pull request or an issue is stale
Projects
None yet
Development

No branches or pull requests

2 participants