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.0.0-beta.13] VList event update:selected data typed as array of string no matter the item value type #15873

Closed
aentwist opened this issue Oct 11, 2022 · 0 comments
Assignees
Labels
C: VList VList E: group Group composable T: bug Functionality that does not work as intended/expected typescript
Milestone

Comments

@aentwist
Copy link

Environment

Vuetify Version: 3.0.0-beta.13
Last working version: 2.6.6
Vue Version: 3.2.40
Browsers: Firefox 91.0
OS: Linux x86_64

Steps to reproduce

As in the title, even if a custom value is used for selected items, the expected event data is an array of string. This typing is defined here.

For example,

<VList v-model:selected="selectedBooks" select-strategy="leaf">
  <VListItem
    v-for="book in books"
    :key="book.id"
    :value="book"
    :title="book.title"
    :subtitle="book.author"
   />
</VList>
(property) selected?: string[] | undefined
Type 'Book[]' is not assignable to type 'string[]'.

In Vuetify 2, v-list-item-group typed the data as any[]. Note also that the selected prop appears to take any[] (needs verification).

Maybe if the goal was to improve upon any, could a generic somehow be used here? Either way, any is better than string here.

Expected Behavior

No type error

Actual Behavior

Type error (still works)

@KaelWD KaelWD added T: bug Functionality that does not work as intended/expected C: VList VList E: group Group composable typescript and removed S: triage labels Oct 21, 2022
@KaelWD KaelWD added this to the v3.0.0-beta milestone Oct 21, 2022
@KaelWD KaelWD self-assigned this Oct 21, 2022
KaelWD added a commit that referenced this issue Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VList VList E: group Group composable T: bug Functionality that does not work as intended/expected typescript
Projects
None yet
Development

No branches or pull requests

2 participants