vuetifyjs / vuetify

🐉 Vue Component Framework
https://vuetifyjs.com
MIT License
39.89k stars 6.97k forks source link

[Feature Request] Combobox: Emit an event on item creation #5682

Open totakoko opened 5 years ago

totakoko commented 5 years ago

Problem to solve

When using a Combobox with multiple values, it is currently not possible to know when a new item is created (that is an item not in the list). The only way to know this information would be to compute the difference between the selected items and the whole list.

Proposed solution

The component could emit a "new-item" event when a new item gets created.

KaelWD commented 5 years ago

Duplicate of #4054

totakoko commented 5 years ago

I'm not sure this is a duplicate as I'm not interested in getting notified when a item is selected or deselected, I only want to get notified when a new item is created. I think this is only valid with combobox.

The use case would be to save and persist this new item so it can be reused in the list of the combobox.

I've committed a simple fix which seems to work. May I make a PR for this ?

KaelWD commented 5 years ago

I think if we're adding the other two might as well have this too, although the workaround is much simpler than diffing the items like you need for autocomplete.

bernardocs commented 5 years ago

This featured (with @totakoko fix) proved very useful... Thx :))

johnleider commented 1 year ago

Duplicate of https://github.com/vuetifyjs/vuetify/issues/5682?