vuetify icon indicating copy to clipboard operation
vuetify copied to clipboard

[Bug Report][3.3.7] Why is :multiple="true" not allowed on v-select?

Open dkern opened this issue 2 years ago • 11 comments

Environment

Vuetify Version: 3.3.7 Vue Version: 3.3.2 Browsers: Chrome 114.0.0.0 OS: Windows 10

Steps to reproduce

It's not allowed to set :multiple="true", because the type definition only allow false|undefined. It's working anyway, but I always get a warning:

Type true is not assignable to type false | undefined

Expected Behavior

No warning.

Actual Behavior

Functional, but get warning.

Reproduction Link

(does not show the type error there) https://play.vuetifyjs.com/#...

dkern avatar Jul 15 '23 18:07 dkern

I believe there may be some confusion regarding the usage of the "multiple" prop and the redundancy of binding the value of "multiple" to true. It is worth noting that in VueJS components, the implicit true value is sufficient, rendering the explicit binding unnecessary.

 <v-select :multiple="true" />
 <v-select multiple />

Would you kindly share the warning console error message, please?

santiagoaloi avatar Jul 16 '23 22:07 santiagoaloi

I actually can't, because i'm on holiday now. ;)

But some thoughts:

  • How would you define multiple dynamically then?

  • Why does :flat="true" on Buttons for example works fine?

  • I work on a project where a linting rule doesn't allow empty HTML attributes/properties. So in plain HTML it would be multiple="multiple" or multiple="1", what both is not allowed too.

dkern avatar Jul 17 '23 04:07 dkern

#17211

KaelWD avatar Jul 17 '23 05:07 KaelWD

#17211

Oh yes, it seems like the same behavior. But without using volar. 😉

dkern avatar Jul 17 '23 05:07 dkern

How are you getting typescript warnings in vue templates without volar

KaelWD avatar Jul 17 '23 05:07 KaelWD

Using webStorm/phpStorm you get volar like errors within the IDE too.

dkern avatar Jul 17 '23 05:07 dkern

Doesn't current webstorm use Volar as well? It's 1.6.5 though, not sure if you can update it or just have to wait for next webstorm

image

jacekkarczmarczyk avatar Jul 17 '23 05:07 jacekkarczmarczyk

I'm using phpStorm, what should be the same base as webStorm, but I never noticed this. I thought they re-implrmented these checks. I was sure I read about it in the official youtrack. But I might be wrong here. I will definitly check this when I'm back.

But eigther way, the messages are the same it seems.

dkern avatar Jul 17 '23 05:07 dkern

After a Quick search it seems we are both right. Until now they had an own Implementation but currently working on integrating Volar to it. But as far as I saw it seems to be still in testing ...

dkern avatar Jul 17 '23 06:07 dkern

It works correctly for me with VSCode + Volar 1.6.5, VSCode + Volar 1.8.5, and PHPStorm + Volar 1.6.5. Jetbrains' homegrown typescript integration doesn't work with TS 5 so I didn't check that, and it's a heap of shit anyway so we won't support it.

KaelWD avatar Jul 18 '23 05:07 KaelWD

Yeah i got same warning on Webstorm IDE but it is working...

alisacorporation avatar Jul 23 '23 20:07 alisacorporation