I've been working on implementing Select2 with Bootstrap 4 for my <select>
elements.
Unfortunately, I ran into an issue because there isn't an official Bootstrap 4 template for Select2. However, I came across this project which seems to be quite impressive.
The problem I'm facing is with the is-invalid
class.
Whenever I apply this class, the borders of my <select>
elements turn red when the page loads and then revert back to their original state.
I attempted to create a custom class to mimic the Bootstrap color scheme like this:
.invalid-select2 {
border-color: #dc3545;
}
.invalid-select2:focus {
border-color: #dc3545;
box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}
However, the issue persists;
You can observe the problem in action on JSFIDDLE
Does anyone have any suggestions on how to resolve this?
Thank you in advance!