Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Bug Report][3.7.0] Using the v-treeview directory tree to duplicate node and parent node names leads to an endless loop #20389

Closed
zulezhe opened this issue Aug 24, 2024 · 4 comments · Fixed by con-cis/mc-docu#48 · May be fixed by mygivvara/codex#5 or aurelienfvre/sae401#1
Labels
C: VTreeview VTreeview labs T: bug Functionality that does not work as intended/expected
Milestone

Comments

@zulezhe
Copy link

zulezhe commented Aug 24, 2024

Environment

Vuetify Version: 3.7.0
Vue Version: 3.3.4
Browsers: Edge 128.0.0.0
OS: Windows

Steps to reproduce

I want to use the v-treeview to display my project directory. I also have the src directory under my src directory. When I click src to expand it, I get stuck in a loop

Expected Behavior

available

Actual Behavior

not available

Reproduction Link

https://play.vuetifyjs.com/#...

@J-Sek
Copy link
Contributor

J-Sek commented Aug 25, 2024

I was able to fix it by adding unique ID to every item and using it instead of title for item-value. (Playground)

I can also just drop item-value and it seems to work fine.

Are you sure VTreeView should work normally with incorrect declaration?

@yuwu9145
Copy link
Member

item-value shouldn't be duplicated. You should either:

  • "Adding unique ID to every item" like @J-Sek suggested above
  • Or use return-object (demo)

@yuwu9145 yuwu9145 closed this as not planned Won't fix, can't repro, duplicate, stale Aug 25, 2024
@J-Sek
Copy link
Contributor

J-Sek commented Aug 25, 2024

I have managed to pinpoint specific place where the code get's stuck:

image

In theory we could mitigate issue by throwing exception once we detect duplicated ID. Tree view will be unexpectedly unable to expand specific node, but at least end-user's browser tab won't have a chance to freeze. I am curious about @yuwu9145 's opinion on it.

@yuwu9145
Copy link
Member

Adding a warning message would be a good solution, feel free to open a PR

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C: VTreeview VTreeview labs T: bug Functionality that does not work as intended/expected
Projects
None yet
4 participants