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

Dynamic static changes on children do not change children rendering #2024

Open
Kogoro opened this issue Mar 1, 2024 · 2 comments
Open

Dynamic static changes on children do not change children rendering #2024

Kogoro opened this issue Mar 1, 2024 · 2 comments

Comments

@Kogoro
Copy link

Kogoro commented Mar 1, 2024

Describe the bug

I tried to dynamically set static, draggable and resizable attributes to grid items but RGL does not react to the changes.
Also forcing an update over a reference via forceUpdate() or render() do not process the children again.
I think the responsible change detection for layouting is not aware of the attributes, because after disabling draggable and resizable for RGL and enabling it again, the component will be rendered correctly.
This happens for me with the data-grip and layout mechanism.

Your Example Website or App

https://github.com/Kogoro/bug-rgl

Steps to Reproduce the Bug or Issue

  1. Click Lock -> Widget is still shown as false
  2. Toggle Edit -> Widget shows the correct value
  3. Try clicking lock again -> Widget is moving around and nothing changes

Expected behavior

As a user, I expected a rerender of at least the updated child component so that dragging and resizing will be toggled.

react-grid-layout library version

1.4.4

Operating System Version

Windows

Browser

Firefox

Additional context

Nextjs 14.1

The problem is similar to #1936 but concentrate on individual GridItems and not global on RGL level.

Screenshots or Videos

No response

@BeardedBoy
Copy link

In your code, try putting const DecoratedReactGridLayout = WidthProvider(ReactGridLayout) inside the component to make it re-render, which may work, but this is not a good solution.

@Kogoro
Copy link
Author

Kogoro commented Mar 11, 2024

Thanks for the suggestion. I tried to put it inside the Home Function, but sadly it does not change any behavior of the grid. The changes don't appear until an edit mode change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants