Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootstrap validation is #134

Open
rostamiani opened this issue Dec 18, 2019 · 0 comments
Open

Bootstrap validation is #134

rostamiani opened this issue Dec 18, 2019 · 0 comments

Comments

@rostamiani
Copy link

When using Bootstrap invalid fields are green instead of red. The problem is that the "ng-invalid" class is added to the field but ":valid" is still applied.
This is the input field:

<input [(ngModel)]="request.count" type="number" 
class="form-control" name="count" id="count" autocomplete="off" 
[min]="1" [max]="warehouseRequest.count_request" pattern="^\d+$" required>

And this is the generated DOM:

<input _ngcontent-vyd-c6="" autocomplete="off" 
class="form-control ng-touched ng-dirty ng-invalid"
name="count" pattern="^\d+$" required="" type="number" ng-reflect-required="" 
ng-reflect-pattern="^\d+$" ng-reflect-max="10" ng-reflect-min="1" ng-reflect-name="count" 
ng-reflect-model="-5">

And this is the output of checkValidity() function:

image

And the form itself:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant