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

Commit

Permalink
fix(autocomplete): fix autocomplete tabindex support
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
devversion authored and ThomasBurleson committed Apr 1, 2016
1 parent 2023a33 commit 321feb0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/autocomplete/js/autocompleteDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ function MdAutocomplete () {
// removing the element is hidden while retrieving the template. For example when using ngIf.
if (noItemsTemplate) element.attr('md-has-not-found', true);

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

return '\
<md-autocomplete-wrap\
Expand Down

0 comments on commit 321feb0

Please sign in to comment.