Skip to content

Commit e82e64d

Browse files
kstepIgorMinar
authored andcommitted
fix(input): recognize 'password' as an html input type
1 parent 8978e06 commit e82e64d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/widget/input.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ function numericRegexpInputType(regexp, error) {
579579

580580
var HTML5_INPUTS_TYPES = makeMap(
581581
"search,tel,url,email,datetime,date,month,week,time,datetime-local,number,range,color," +
582-
"radio,checkbox,text,button,submit,reset,hidden");
582+
"radio,checkbox,text,button,submit,reset,hidden,password");
583583

584584

585585
/**

test/widget/inputSpec.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,14 @@ describe('widget: input', function() {
405405
});
406406

407407

408+
describe('password', function () {
409+
it('should not change password type to text', function () {
410+
compile('<input type="password" ng:model="name" >');
411+
expect(element.attr('type')).toBe('password');
412+
});
413+
});
414+
415+
408416
it('should ignore text widget which have no name', function() {
409417
compile('<input type="text"/>');
410418
expect(scope.$element.attr('ng-exception')).toBeFalsy();

0 commit comments

Comments
 (0)