html - Angular Input invalid when decimal within min and max -
i'm having weird issue don't understand why it's happening...
i'm using angular 1.6.1 , input invalid when between max , min values on input box. seems happen when values decimals decimal step. have tested on chrome , edge , same thing. tried googling couldn't find relative.
var myapp = angular.module('myapp', []); myapp.controller('myctrl', function($scope) { $scope.prices = { "net": { "min": 0.00, "max": 9999.99 } }; }); <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-bvyiisifek1dgmjrakycuhahrg32omucww7on3rydg4va+pmstsz/k68vbdejh4u" crossorigin="anonymous"> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <div ng-app="myapp"> <div ng-controller="myctrl"> <form name="priceform" novalidate> <div class="form-group" ng-class="{'has-error': priceform.netmax.$invalid && priceform.netmax.$dirty }"> <label>max price:</label> <input class="form-control" name="netmax" type="number" min="0.00" step="0.01" max="9999.99" ng-step="0.01" ng-model="prices.net.max" /> </div> </form> <p> try reducing input 9999.97. reason invalid. </p> </div> </div>
changing version of angular 1.6.4 seems have solved issue. there must bug in version 1.6.1
Comments
Post a Comment