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

new tag creation management - option:beforeCreated #1748

Open fabiodp1 opened 1 year ago

fabiodp1 commented 1 year ago

Hi, I couldn't find a way "out of the box" to manage new tag creation and validation before it is created, for example a "beforeCreated" event. For instance I'd need to check if the new tag contains non-alphanumeric tags, and if so show a warning and stop the tag creation, stopping the push, state update and consequent events. I guess it could be very useful in many cases. Thanks

gwenf commented 1 year ago

Yes, this is what I think I need as well. I need some way to enforce a character limit on new options.

Edit: this answer actually fixed my issue (not the same issue as OP): https://github.com/sagalbot/vue-select/issues/241#issuecomment-596250097