-
Notifications
You must be signed in to change notification settings - Fork 5
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
Dynamically resize items #11
Comments
Thank you very much for your like about ruuri. Referring to the two examples mentioned above, I make slight changes based on your example to see here if it helps you solve this issue. I did two things in this example:
|
It's a good starting point, thanks! |
I've got another issue. If you could check it out when you have time Screen.Recording.2023-06-10.at.2.36.47.AM.mov |
As I can see, the DraggableGrid has re-rendered because of the state called items has changed, the children prop of DraggableGrid has changed, it would be re-render. I think this is react way However I add memo for grid, it seems like solve this issue. And there is an example forked from your codesandbox above, check it out here Hope that helps you |
|
Let's talk back at this issue. I have an idea, how about that we can store this scroll position before update items, and restore its scroll position after items have updated. |
@vingeraycn I think I've found a simple solution. I added this CSS snippet:
It sets the |
I've got an issue when removing items from the grid and would greatly appreciate it if you could check it out. |
No thanks, I think this behavior is not suitable for ruuri as a library, the library shouldn't do any hacks as little as possible for code robustness. however, it's very appreciate for your tests. :) |
I reproduced this problem, which looks a little strange, like the problem of draggable-items cache control inside muuri. Possible related issues: |
I found some issues, please wait for my news, I am trying to fix sync problem between data model and views. Update: I am work on this pr #12 |
Hi @romanstetsyk , could you try the new version Tips: the new version has some break change, learn more at here Thanks a lot. |
@vingeraycn, thanks for the update! |
I got it! I missed to emphasize the uni key field in BTW I organized code, and released |
@vingeraycn I've set up a new codesandbox to test Screen.Recording.2023-06-20.at.1.09.30.AM.mov |
I try to fix those issues, and I have tested your examples above. Now v2.0.0-2 is available. |
I appreciate your fast reply! I've updated |
It looks normal about model-view sync issue. There are some infos about issue:
I tried to remove DOM element when data was changed by using And I followed error stack, found the error came from code Back to now, the removeElements option of Thanks! @romanstetsyk |
Actually, removing items work fine with |
Is there any way to resize grid items dynamically like in this codesandbox that uses
muuri-react
Here is a codesandbox with my attempt, but the items overlap on resize.
Any help would be appreciated, and thanks for creating this wrapper!
The text was updated successfully, but these errors were encountered: