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

[Bug Report][3.3.14] VList with selection doesn't work when children is an empty array #18172

Closed
mlankamp opened this issue Aug 29, 2023 · 5 comments
Labels
working as intended The issue is working as intended

Comments

@mlankamp
Copy link

Environment

Vuetify Version: 3.3.14
Vue Version: 3.3.4
Browsers: Edge 117.0.2045.9
OS: Windows

Steps to reproduce

Using the prepend template the checkbox is added with the needed events. When the children property is set to an empty array, the select functionality doesn't work. When the children is set to null or undefined it does work

Expected Behavior

Allow the children to be set to empty array.

Actual Behavior

An empty array causes the children to behave differently

Reproduction Link

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

@mlankamp
Copy link
Author

The empty array causes the children to render differently:
image

@mlankamp
Copy link
Author

mlankamp commented Aug 29, 2023

The problem can be solved in VListChildren.tsx (

)

to add an additional check (besides null and undefined) for the array length
return children && children.length > 0 ? (

This solves the problem, and when there are no children it's more logical to render a listitem and not a listgroup

@KaelWD
Copy link
Member

KaelWD commented Aug 30, 2023

@mlankamp
Copy link
Author

I will check if this conflict with my proposed change. If so, I will close this PR

@mlankamp
Copy link
Author

Closed the PR, doesn't work for an async scenario

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
working as intended The issue is working as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants