-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Layout grid item is not made static when the "static" property of a layout is updated from false to true #1513
Comments
Hi, I have encountered the same exact issue, if the layout started with an item static, changing it's value to false will not change the GridItem's behavior, same as with isDraggable, and the same goes for if the layout has an item not static, changing the value will not change its behavior. |
@komoo1 I encountered same issue, but found a hack to fix it. The onLayoutChange 2nd parameter layouts, still holds on to the old values before the static update. You will have to update it with the new value, and set it in Redux store in my case/ react state. |
@adi-sekar this is only when onLayoutChange is triggered, if no item was repositioned or had a change of dimensions the function will not be triggered. Nevertheless it might work, and thank you for taking the time to check it. |
@ofekkazes Is there another event, which gets triggered if static is updated or say something like minWidth/isDraggable etc, some thing which does not affect the layout position immediately get changed? |
Any update on this? I am encountering the same issue! |
@pietromassiccio The fix I did for this, is to |
@adi-sekar Thanks for the idea, however as @ofekkazes pointed out |
@komoo1 I think it's just a bug in your code at line 75. You should be comparing against a string and not an integer. Exchange that with
|
For now I had used the isDraggable prop on RGL which locks the layout and is working as expected, instead of locking one item, locking every one is the best next thing :) |
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 |
CodeSandbox Link
https://codesandbox.io/s/practical-elgamal-h3c6y?file=/src/ShowcaseLayout.js
Steps to Recreate Issue:
Expectation
The text was updated successfully, but these errors were encountered: