Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 321feb0

Browse files
devversionThomasBurleson
authored andcommitted
fix(autocomplete): fix autocomplete tabindex support
- We should always apply to the root directive a tabindex of `-1` - We should direct the tabindex to the input (if tabindex is specified) - Added accompanying tests Fixes #6999. Closes #7005 # Conflicts: # src/components/autocomplete/autocomplete.spec.js
1 parent 2023a33 commit 321feb0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/components/autocomplete/js/autocompleteDirective.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ function MdAutocomplete () {
163163
// removing the element is hidden while retrieving the template. For example when using ngIf.
164164
if (noItemsTemplate) element.attr('md-has-not-found', true);
165165

166-
if (!attr.hasOwnProperty('tabindex')) element.attr('tabindex', '-1');
166+
// Always set our tabindex of the autocomplete directive to -1, because our input
167+
// will hold the actual tabindex.
168+
element.attr('tabindex', '-1');
167169

168170
return '\
169171
<md-autocomplete-wrap\

0 commit comments

Comments
 (0)