Skip to content

Commit 1c0aa0c

Browse files
revert:fix(input): ensure that hidden input values are correct after history.back
This reverts commit c49fb56. There was a regression in angular-material that relied upon the input directive having `link.pre` property
1 parent 5d4cd81 commit 1c0aa0c

File tree

3 files changed

+9
-39
lines changed

3 files changed

+9
-39
lines changed

src/ng/directive/input.js

+9-12
Original file line numberDiff line numberDiff line change
@@ -1930,20 +1930,17 @@ var inputDirective = ['$browser', '$sniffer', '$filter', '$parse',
19301930
return {
19311931
restrict: 'E',
19321932
require: ['?ngModel'],
1933-
compile: function(tElement, tAttr) {
1934-
if (lowercase(tAttr.type) === 'hidden') tAttr.$set('autocomplete', 'off');
1935-
return {
1936-
pre: function(scope, element, attr, ctrls) {
1937-
if (ctrls[0]) {
1938-
var type = lowercase(attr.type);
1939-
if ((type === 'range') && !attr.hasOwnProperty('ngInputRange')) {
1940-
type = 'text';
1941-
}
1942-
(inputType[type] || inputType.text)(scope, element, attr, ctrls[0], $sniffer,
1943-
$browser, $filter, $parse);
1933+
link: {
1934+
pre: function(scope, element, attr, ctrls) {
1935+
if (ctrls[0]) {
1936+
var type = lowercase(attr.type);
1937+
if ((type === 'range') && !attr.hasOwnProperty('ngInputRange')) {
1938+
type = 'text';
19441939
}
1940+
(inputType[type] || inputType.text)(scope, element, attr, ctrls[0], $sniffer,
1941+
$browser, $filter, $parse);
19451942
}
1946-
};
1943+
}
19471944
}
19481945
};
19491946
}];

test/e2e/fixtures/input-hidden/index.html

-10
This file was deleted.

test/e2e/tests/input-hidden.spec.js

-17
This file was deleted.

0 commit comments

Comments
 (0)