Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
fix(typeahead): Fix tab index for hint input
Browse files Browse the repository at this point in the history
Fixes needing to hit tab twice to tab into typeahead with show hint enabled.

Fixes #5478
Closes #5492
  • Loading branch information
deeg committed Feb 16, 2016
1 parent 3814fe3 commit 4178500
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/typeahead/test/typeahead.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1211,6 +1211,11 @@ describe('typeahead tests', function() {
triggerKeyDown(element, 27);
expect(hintEl.val()).toEqual('');
});

it("should set tab index on hint input element", function(){
var hintEl = findInput(element);
expect(hintEl.attr('tabindex')).toEqual('-1');
});
});

describe('append to', function() {
Expand Down
1 change: 1 addition & 0 deletions src/typeahead/typeahead.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', 'ui.bootstrap
element.after(inputsContainer);
hintInputElem = element.clone();
hintInputElem.attr('placeholder', '');
hintInputElem.attr('tabindex', '-1');
hintInputElem.val('');
hintInputElem.css({
'position': 'absolute',
Expand Down

0 comments on commit 4178500

Please sign in to comment.