Not duplicate
Previous questions (on this topic) with answers are 4-5 years old and refer to respective project's old versions.
Status
In the project i am using:
- Bootstrap v4.4.1
- jQuery validation plugin v1.19.1
- Select2 v4.0.13
- Select2 Bootstrap4 theme v1.3.2
The problem
Bootstrap4
works well with jQuery validation plugin
.
jQuery validation
does not work with Select2
out of the box.
I managed to add outline for valid/invalid state
.
Yet i can not make it to disappear on blur
(clicking in white area of the page out of controls) as is the case with only Bootstrap4
and jQuery validation
.
Examples
I created 2 JSFiddle-s that show the problem.
jQuery Validation
+ bootstrap4
= working as intended: Example 1
jQuery Validation
+ bootstrap4
+ Select2
= problem: Example 2
Conclusion
I have meticulously looked through existing similar questions on StackOverflow
and tried out most of suggestions, yet they reference old versions of libraries and are not applicable in current case as in the new versions of libraries there are used different code structure... so old solutions do not work anymore... I tried to account for that when applying solutions, but to no avail.
At this point i am stuck.
Thank you for ideas and proposals!