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

Commit 4178500

Browse files
committed
fix(typeahead): Fix tab index for hint input
Fixes needing to hit tab twice to tab into typeahead with show hint enabled. Fixes #5478 Closes #5492
1 parent 3814fe3 commit 4178500

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/typeahead/test/typeahead.spec.js

+5
Original file line numberDiff line numberDiff line change
@@ -1211,6 +1211,11 @@ describe('typeahead tests', function() {
12111211
triggerKeyDown(element, 27);
12121212
expect(hintEl.val()).toEqual('');
12131213
});
1214+
1215+
it("should set tab index on hint input element", function(){
1216+
var hintEl = findInput(element);
1217+
expect(hintEl.attr('tabindex')).toEqual('-1');
1218+
});
12141219
});
12151220

12161221
describe('append to', function() {

src/typeahead/typeahead.js

+1
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', 'ui.bootstrap
129129
element.after(inputsContainer);
130130
hintInputElem = element.clone();
131131
hintInputElem.attr('placeholder', '');
132+
hintInputElem.attr('tabindex', '-1');
132133
hintInputElem.val('');
133134
hintInputElem.css({
134135
'position': 'absolute',

0 commit comments

Comments
 (0)