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

Issues rendering and dragging nested entries with two arrays #611

Open
prengaiah opened this issue Oct 18, 2024 · 2 comments
Open

Issues rendering and dragging nested entries with two arrays #611

prengaiah opened this issue Oct 18, 2024 · 2 comments

Comments

@prengaiah
Copy link

Hi,

I have a requirement that expects a domain model and behavior as below -

Collection is the root object. It contains an array of "Category" entries. These entries can be rearranged. Each category contains two array attributes besides id. They are "items" and "children". Items array can contain one or more CategoryItem. Each CategoryItem has an array attribute called "children". Children array can contain one or more Category objects both at the Category level and at CategoryItem level.

Here is the REPL link of a sample implementation - https://svelte.dev/repl/84ab5ed6768645878ff4aebad7eb65b7?version=4.2.19

There are few problems that I am facing -

  1. I am sure there is some silly mistake, but when I run the code, it doesn't render the entire tree. For example, the Category "category - 2" should show up under "category - 1" as one of the "child" entry.
  2. Dragging any of the "Category" objects and trying to drop at another Category or Item throws getBoundingClientRect error and screen freezes.

Any help pointing issues in my implementation would be helpful.

Thanks.

@isaacHagoel
Copy link
Owner

isaacHagoel commented Oct 18, 2024 via email

@prengaiah
Copy link
Author

My bad, was following a guide and didn't notice missing on:consider or and on:finalize. Will modify my code and test it. Thanks for the quick response.

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