-
Notifications
You must be signed in to change notification settings - Fork 40
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
Do not error when data has nodes removed that are expanded #174
base: master
Are you sure you want to change the base?
Conversation
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I'm happy to update the PR in any way if necessary to get it merged. Thank you in advance. |
@blittle I’ve asked my team to look at it |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue was closed automatically since it was marked as stale because it has not had recent activity. Thank you for your contributions. |
Why was this closed? I think this is a fine solution to issue #133 |
Stalebot closed it. I’ll reopen it. |
I'd really love to see this get merged. Working around it from outside the library is proving to be a very convoluted process. |
Would like to see this merged as well. I'm trying to save expanded state when watching a filesystem folder, so if a subfolder is deleted on the OS and the expandedId was saved in local state then it errors because the node doesn't exist in the tree anymore. A "quiet" failure is expected for my use-case. I would expect just like this PR fixes, the node is ignored. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@yhy-1, @mellis481, seems like we have a lot of interest here. Is this PR up to snuff? I believe we have an internal tracking ticket to review this. Not sure if it’s been prioritized. But I’m commenting to keep stalebot from closing it. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue was closed automatically since it was marked as stale because it has not had recent activity. Thank you for your contributions. |
I'd love to see this get merged, please reopen. |
We use
react-accessible-treeview
at Shopify along with folder/file search. With our implementation the rendered nodes change based on the search query. We also want the nodes to default to being expanded. As shown with the included test,TreeView
breaks when re-rendered where both thedata
andexpandedIds
props change.The problem is that the previous expandedIds data is stored, and the difference is calculated. But an ID should not be included in the difference if that ID doesn't still exist in the data. As I see it, there are two solutions:
This resolves #133
I think I have a workaround by never removing nodes from the tree, and instead adding a boolean to the metadata whether or not it should be displayed.