Skip to content

[Bug Report][3.8.4] v-treeview: Deep Nesting Leads to Rendering/Hover Problems #21387

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

Open
Rhaegal0411 opened this issue May 8, 2025 · 13 comments · May be fixed by #21443
Open

[Bug Report][3.8.4] v-treeview: Deep Nesting Leads to Rendering/Hover Problems #21387

Rhaegal0411 opened this issue May 8, 2025 · 13 comments · May be fixed by #21443
Assignees
Labels
C: VTreeview help wanted We are looking for community help T: bug Functionality that does not work as intended/expected

Comments

@Rhaegal0411
Copy link

Environment

Vuetify Version: 3.8.4
Vue Version: 3.5.9
Browsers: Chrome 136.0.0.0
OS: Windows, iOS, Android, Mac OSX

Steps to reproduce

I’m encountering an issue with v-treeview when rendering deeply nested trees (10+ levels deep). When the tree exceeds the viewport height, two problems occur:

Rendering glitches: Nodes in deeper levels become progressively distorted (squished, overlapping) and eventually disappear entirely at the bottom. This suggests the component may not be correctly handling scrollable container boundaries or layout recalculations.
Hover misalignment: The hover background effect appears offset from the actual node when scrolling. The hover state seems to ignore scroll offsets, making it difficult to interact with nodes at lower levels.

The above content was translated. I hope the expression is accurate.

Expected Behavior

work normally

Actual Behavior

work unnormally

Reproduction Link

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

@Indogermane
Copy link

I don't see any problems.

Are you aware, that your data looks like: 18, 19, 22 ?

                                    children: [{
                                      title: 'logo18.png',
                                      file: 'png',
                                      children: [{
                                        title: 'logo19.png',
                                        file: 'png',
                                        children: [{
                                          title: 'logo22.png',
                                          file: 'png',
                                        }],
                                      }],
                                    }],

@Rhaegal0411
Copy link
Author

I don't see any problems.

Are you aware, that your data looks like: 18, 19, 22 ?

                                    children: [{
                                      title: 'logo18.png',
                                      file: 'png',
                                      children: [{
                                        title: 'logo19.png',
                                        file: 'png',
                                        children: [{
                                          title: 'logo22.png',
                                          file: 'png',
                                        }],
                                      }],
                                    }],

When you shrink the preview window down to a sufficiently small size, you might spot that; and these data is just some quick examples I threw in😄😄

@jcjp
Copy link
Contributor

jcjp commented May 11, 2025

When you shrink the preview window down to a sufficiently small size, you might spot that; and these data is just some quick examples I threw in😄😄

Same with Indogermane, I didn't saw any issues I also tried resizing the window of the preview on you reproduction playground. Would you be able to provide us a video or image of what you are encountering so we could understand it better?

@jcjp jcjp added S: needs reproduction The issue does not contain a valid reproduction S: needs more information labels May 11, 2025
@Rhaegal0411
Copy link
Author

When you shrink the preview window down to a sufficiently small size, you might spot that; and these data is just some quick examples I threw in😄😄

Same with Indogermane, I didn't saw any issues I also tried resizing the window of the preview on you reproduction playground. Would you be able to provide us a video or image of what you are encountering so we could understand it better?

Thank you for reminding me. Here's how the code renders in my browser:
Image
When scroll all the way to the right, it doesn't seem work properly, is it possible that the problem is attribute to my browser(version 136.0.7103.93)?

@johnleider
Copy link
Member

Thank you, that helps a lot:

Image

@johnleider johnleider added T: bug Functionality that does not work as intended/expected help wanted We are looking for community help C: VTreeview and removed S: needs reproduction The issue does not contain a valid reproduction S: needs more information S: triage labels May 15, 2025
@J-Sek
Copy link
Contributor

J-Sek commented May 15, 2025

Please try:

.v-list-item__content {
  min-width: max-content;
}

@Rhaegal0411
Copy link
Author

Thank you for the advice, i tried this but it still seems to be the same, did i miss something?
here's the reproduction playground link: reproduction

Image

@J-Sek
Copy link
Contributor

J-Sek commented May 16, 2025

No, it's OK. I have missed the hover effect issue.

:deep(.v-list-group__items),
:deep(.v-list-item__content) {
  width: max-content;
}

Also, it seems regular width without !important is good enough.

@Rhaegal0411
Copy link
Author

No, it's OK. I have missed the hover effect issue.

:deep(.v-list-group__items),
:deep(.v-list-item__content) {
width: max-content;
}
Also, it seems regular width without !important is good enough.

Thanks a lot @J-Sek , this works fine for me; And thanks for correcting me about !important, i've got it.

@J-Sek
Copy link
Contributor

J-Sek commented May 17, 2025

min-width: max-content; would actually play better with #append slot, should you add any icon or content to the right.

I am exploring the possibility to include it somehow in the framework. It needs to be behind some prop. Cannot be the default (demo).

@Rhaegal0411
Copy link
Author

maybe expose some prop that can set fixed width for list items?

@J-Sek J-Sek assigned J-Sek and unassigned ikushum May 20, 2025
@J-Sek
Copy link
Contributor

J-Sek commented May 20, 2025

Switched to min-content and static min-width for the item content.

.v-list-group__items {
  min-width: min-content;
}
.v-list-item__content {
  min-width: 40px;
}

This way the component keeps truncating but does not hide the content completely. No additional prop necessary.

@Rhaegal0411
Copy link
Author

Switched to min-content and static min-width for the item content.

.v-list-group__items {
min-width: min-content;
}
.v-list-item__content {
min-width: 40px;
}
This way the component keeps truncating but does not hide the content completely. No additional prop necessary.

This does help, thanks again for tracking this issue @J-Sek

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VTreeview help wanted We are looking for community help T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants