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

fix(VList): pass return-object to nested VListChildren #19848

Merged
merged 1 commit into from
May 21, 2024

Conversation

yuwu9145
Copy link
Member

@yuwu9145 yuwu9145 commented May 21, 2024

Description

v-list prop return-object is not propagating down into the child list items as being set to true.
So what happens is top level items do return a object but a selected child item will return item-value instead of item

Reproduction playground

Markup:

<script setup>
  import { ref } from 'vue';


  const selections = ref([])

  function onOpen() {
    console.log(arguments)
  }

const items = [
  {
   title: 'Option 1',
   subtitle: 'This is option 1',
   value: 1,
  },
  {
    title: 'Option 2',
    subtitle: 'This is option 2',
    value: 2,
    children: [
      {
        title: 'Option 1',
        subtitle: 'This is option 1',
        value: 1,
      },
    ]
  },
]
</script>

<template>
  <v-card class="mx-auto" max-width="400">
    <v-toolbar color="purple">
      <v-btn icon="mdi-menu"></v-btn>

      <v-toolbar-title>Settings</v-toolbar-title>

      <v-spacer></v-spacer>

      <v-btn icon="mdi-magnify"></v-btn>
    </v-toolbar>

    <v-divider></v-divider>

    <v-list
      selectable
      v-model:selected="selections"
      @click:open="onOpen"
      :items="items"
      lines="three"
      select-strategy="classic"
      return-object
    />

    <pre>{{ selections }}</pre>
  </v-card>
</template>

@MajesticPotatoe MajesticPotatoe added T: bug Functionality that does not work as intended/expected C: VList VList labs and removed labs labels May 21, 2024
@KaelWD KaelWD added this to the v3.6.x milestone May 21, 2024
@KaelWD KaelWD merged commit feeb467 into master May 21, 2024
19 checks passed
@KaelWD KaelWD changed the title fix(VListChildren): pass return-object to nested VListChildren fix(VList): pass return-object to nested VListChildren May 21, 2024
@KaelWD KaelWD deleted the fix-vlist-children-return-object branch May 21, 2024 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VList VList T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants