Skip to content

Commit

Permalink
allow was-validated class to work on select elements without selectpi…
Browse files Browse the repository at this point in the history
…cker class (#2176)

The .selectpicker class may not exist on the select element if it was initialized directly via javascript
  • Loading branch information
Aaron-P authored and caseyjhol committed Sep 21, 2019
1 parent c35ee85 commit b7d5055
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions less/bootstrap-select.less
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ select.selectpicker {
.has-error & .dropdown-toggle,
.error & .dropdown-toggle,
&.is-invalid .dropdown-toggle,
.was-validated & .selectpicker:invalid + .dropdown-toggle {
.was-validated & select:invalid + .dropdown-toggle {
border-color: @color-red-error;
}

&.is-valid .dropdown-toggle,
.was-validated & .selectpicker:valid + .dropdown-toggle {
.was-validated & select:valid + .dropdown-toggle {
border-color: @color-green-success;
}

Expand Down
4 changes: 2 additions & 2 deletions sass/bootstrap-select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ select.selectpicker {
.has-error & .dropdown-toggle,
.error & .dropdown-toggle,
&.is-invalid .dropdown-toggle,
.was-validated & .selectpicker:invalid + .dropdown-toggle {
.was-validated & select:invalid + .dropdown-toggle {
border-color: $color-red-error;
}

&.is-valid .dropdown-toggle,
.was-validated & .selectpicker:valid + .dropdown-toggle {
.was-validated & select:valid + .dropdown-toggle {
border-color: $color-green-success;
}

Expand Down

0 comments on commit b7d5055

Please sign in to comment.