Skip to content

Commit 0960aa6

Browse files
authored
fix(nested): detect and warn about multiple null values (#21940)
fixes #21815
1 parent af20234 commit 0960aa6

File tree

1 file changed

+5
-2
lines changed
  • packages/vuetify/src/composables/nested

1 file changed

+5
-2
lines changed

packages/vuetify/src/composables/nested/nested.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ export const useNested = (props: NestedProps) => {
206206
const path: unknown[] = []
207207
let parent: unknown = toRaw(id)
208208

209-
while (parent != null) {
209+
while (parent !== undefined) {
210210
path.unshift(parent)
211211
parent = parents.value.get(parent)
212212
}
@@ -358,7 +358,10 @@ export const useNestedItem = (id: MaybeRefOrGetter<unknown>, isDisabled: MaybeRe
358358
const parent = inject(VNestedSymbol, emptyNested)
359359

360360
const uidSymbol = Symbol('nested item')
361-
const computedId = computed(() => toRaw(toValue(id)) ?? uidSymbol)
361+
const computedId = computed(() => {
362+
const idValue = toRaw(toValue(id))
363+
return idValue !== undefined ? idValue : uidSymbol
364+
})
362365

363366
const item = {
364367
...parent,

0 commit comments

Comments
 (0)