You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vuetify Version: 3.3.19 Vue Version: 3.3.4 Browsers: Safari 16.6 OS: Mac OS 10.15.7
Steps to reproduce
When supplying VAutocomplete with items of a generic type, v-model is marked with an error, e.g. "type 'string' is not assignable to type 'Val$2<t, false>'."
<template>
<v-app>
<v-container>
<v-autocomplete
v-model="selection"
:items="items"
item-value="value"
item-title="title"
/>
</v-container>
</v-app>
</template>
<script setup lang="ts" generic="T">
// generic="T extends Item" also fails with the same error
import { ref } from 'vue'
import { Item } from './Item';
const items: T[] = []
const selection = ref<string>(null)
</script>
I also had this issue. I evaluated the Val$2<T, false> type myself using the declarations in the vuetify build, and it simplified to any | null | undefined. I ended up casting the selection to any | null and disabling "no-explicit-any" just to show that the issue had been investigated in my code base.
Environment
Vuetify Version: 3.3.19
Vue Version: 3.3.4
Browsers: Safari 16.6
OS: Mac OS 10.15.7
Steps to reproduce
When supplying VAutocomplete with items of a generic type, v-model is marked with an error, e.g. "type 'string' is not assignable to type 'Val$2<t, false>'."
Expected Behavior
This should work without an error
Actual Behavior
An error appears on v-model
Reproduction Link
https://play.vuetifyjs.com/#...
Other comments
This seems to be related to issue #17383 as this had the same kind of error if v-model was supplied with a generic type.
The text was updated successfully, but these errors were encountered: