sagalbot / vue-select

Everything you wish the HTML <select> element could do, wrapped up into a lightweight, extensible Vue component.
https://vue-select.org
MIT License
4.62k stars 1.33k forks source link

A way to prevent createOption to add a new option. #1687

Open LukasOchmann opened 1 year ago

LukasOchmann commented 1 year ago

The options passed to v-select are a suggested list of User which can be added to an Organization. If none of the suggestions match the searched user. It is possible to type in an e-mail which then is added. While that creates a new option, i want to check if the E-Mail is already in the added or suggested Members.

Describe the solution you'd like If either the createOption throws or returns null/undefined adding an option should be omitted.

Additional context I would prefer the throwing variant, because it is maybe important for someone that adding undefined/null works.