React-grid-layout: Layout not refreshed when the width is updated at the same time as the layouts

Created on 22 Oct 2018  路  7Comments  路  Source: STRML/react-grid-layout

There is bug on this condition:
https://github.com/STRML/react-grid-layout/blob/3352c84515e587c2bb7ec7935e24be5705d33704/lib/ResponsiveReactGridLayout.jsx#L147-L155

If one update the width and layouts props at the same time only the width is going to be updated. The internal state.layout is going to stay unchanged as the second condition is skipped.

bug

All 7 comments

@STRML, is this repository still maintained? I don't see any issues beeing answered. Are you expecting PRs or new maintainers?

I'm finding some problems while using the library too.
I've been seeing the code and I think there are a lot of things that can be done, so it would be nice to have a mantainer that can keep this project updated, or maybe there is already a fork with interesting stuff, I don't know...

In my case I've found many problems while working with the library in managed mode, passing the layout prop always and updating it from outside. As the library components has their own State, at some points it gets bugged because it goes from controlled mode to non controlled mode magically.

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

Any update on that?

This should be fixed as of #990 which removed componentWillReceiveProps (deprecated) with static getDerivedStateFromProps, which naturally separated the width and layout change handlers. Please reopen if you are still experiencing a bug here.

Ok, will check. Thank you @STRML

Was this page helpful?
0 / 5 - 0 ratings