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

md-autocomplete autofocus #1764

Closed
RomainFleury opened this issue Mar 3, 2015 · 2 comments
Closed

md-autocomplete autofocus #1764

RomainFleury opened this issue Mar 3, 2015 · 2 comments
Assignees
Milestone

Comments

@RomainFleury
Copy link

Hi,

I am using md-autocomplete in a md-dialog, to show only a button to launch a search.

BTW, I'd like to set focus on autocomplete > input right when it is available.

Is it possible to pass a param into autocompleteDirective ?

Then set it to true when building the input ?

scope: {
searchText: '=mdSearchText',
autofocus: '=mdAutofocus',

function MdAutocomplete () {
return {
template: '

<input type="text"
ng-disabled="isDisabled"
~~autofocus="autofocus"~~

Do you want me to make a plunkr to explain ?

@RomainFleury
Copy link
Author

My html tag is wrong... It isn't possible to set autofocus to false...

But maybe another way ?

@marcysutton
Copy link
Contributor

The dialog currently handles focus on open for accessibility, so would definitely be part of the problem. I'm about to push a fix that will allow focusOnOpen in $mdDialog to be set to false (only to be used when something else is focused).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants