lekoala / bootstrap5-tags

Replace select[multiple] with nices badges for Bootstrap 5
MIT License
150 stars 35 forks source link

Disable Validation #71

Closed ecmel closed 1 year ago

ecmel commented 1 year ago

Is it possible to completely disable validation including adding or removing is-valid and is-invalid classes? I am using just-validate for validation and this behavior clashes with it.

lekoala commented 1 year ago

@ecmel actually validation looks kind of broken right now in 1.5 :) will have a look at this it seems that just-validate works just fine on the other hand so if you have some snippet i can try it would be great

lekoala commented 1 year ago

@ecmel you can have a look at demo.html on master, there is a test form I don't see anything wrong with it

ecmel commented 1 year ago

@lekoala Thank you for the response. Yes it works with just-validate only it does not behave like other input controls. When I submit an invalid form, the tags component behaves normally and becomes red but when I focus the component suddenly is-invalid class is removed by the code. Just cosmetics but validation could be done in an other library and this library can focus on what it does best.

lekoala commented 1 year ago

@ecmel well that's the thing: there is no way an external library can determine if a given tag is valid or not. the whole point of the validation is also to be triggered when typing invalid tags.

is the "is-invalid" class somehow being used by just-validate? maybe the real issue is that the "is-invalid" class is removed as soon as you focus on it, even though no new tag has been entered

lekoala commented 1 year ago

@ecmel i made some more updates on master regarding validation now, it won't remove the is-invalid class when focusing on it until you type something valid

ecmel commented 1 year ago

@lekoala It became worse, I tried with just-validate custom validator which is always returning false, but it passes validation.

lekoala commented 1 year ago

@ecmel a codepen or jsfiddle would certainly help because if you look at the demo.html where there is a just-validate exemple, it works just fine

ecmel commented 1 year ago

@lekoala Thank you very much, latest version is working for me.

lekoala commented 1 year ago

great to hear! closing the issue ;-)