Skip to content

Commit 0d94bff

Browse files
committed
lets ignore HTML 5 input types except "text" with the autosize feature, refs #45, #39, #20
1 parent a1fb966 commit 0d94bff

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/angular-advanced-searchbox.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,13 +320,17 @@ angular.module('angular-advanced-searchbox', [])
320320
}
321321
])
322322
.directive('nitAutoSizeInput', [
323-
function() {
323+
'$parse',
324+
function($parse) {
324325
return {
325326
restrict: 'A',
326327
scope: {
327328
model: '=ngModel'
328329
},
329330
link: function($scope, $element, $attrs) {
331+
if($parse($attrs.type !== 'text'))
332+
return;
333+
330334
var container = angular.element('<div style="position: fixed; top: -9999px; left: 0px;"></div>');
331335
var shadow = angular.element('<span style="white-space:pre;"></span>');
332336

0 commit comments

Comments
 (0)