Skip to content

Option to have .is-invalid (or custom class) applied to the form-control when form is invalid #144

@not-a-doctor-stromberg

Description

@not-a-doctor-stromberg

Would it be possible to put a boolean on the component that apply the .is-invalid (or some other custom class) to the form-control element if the associated Angular FormControl is invalid? This would allow the following bootstrap rule to apply:

.was-validated .form-control:invalid, .form-control.is-invalid, .was-validated
.custom-select:invalid,
.custom-select.is-invalid {
  border-color: #dc3545;
}

As is, I am left creating a style like so to replicate the above rule:

.ng-invalid>div.ngx-select>div>div.form-control {
    border-color: $danger !important;
}

I can open an issue against the ng2-select component if you prefer -- I'm not sure if this is regularly updated from that or not :)

Thanks for the component though!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions