Skip to content
This repository has been archived by the owner on Nov 22, 2021. It is now read-only.

Commit

Permalink
Merge 1074ddd into b63ddab
Browse files Browse the repository at this point in the history
  • Loading branch information
offsky committed Sep 11, 2014
2 parents b63ddab + 1074ddd commit 9276a4b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ tagsInput.provider('tagsInputConfig', function() {
}
else {
updateValue(attrs[key] && $interpolate(attrs[key])(scope.$parent));
if(key==='tabindex') {
attrs[key] = -1; // fixes tab key entering input correctly
}
}
});
},
Expand Down
18 changes: 18 additions & 0 deletions test/configuration.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,24 @@ describe('configuration service', function() {
});
});

it('loads sets tabindex to -1 for root element', function() {
// Arrange
$scope.$parent.tabindex = 2;

attrs.tabindex = '{{ tabindex }}';

// Act
service.load('foo', $scope, attrs, {
tabindex: [Number]
});

// Assert
expect($scope.options).toEqual({
tabindex: 2
});
expect(attrs.tabindex).toEqual(-1);
});

it('loads interpolated values from attributes as they change', function() {
// Arrange
provider.setActiveInterpolation('foo', { prop2: true, prop4: true });
Expand Down

0 comments on commit 9276a4b

Please sign in to comment.