Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot focus() md-input programatically #400

Closed
mreiche opened this issue Apr 4, 2017 · 1 comment
Closed

Cannot focus() md-input programatically #400

mreiche opened this issue Apr 4, 2017 · 1 comment

Comments

@mreiche
Copy link
Contributor

mreiche commented Apr 4, 2017

I cant focus my md-input element like

<md-input ref="inputElement">
doSomething() {
   // Does actual nothing
    this.inputElement.focus();
}
@Thanood
Copy link
Collaborator

Thanood commented Apr 4, 2017

That would be view-model.ref="inputElement" but that only fires the focus() event:
https://gist.run/?id=33129796dff66080f16f0850a7903b20

I'll add it in the next "round" of changes (which is maybe tomorrow but I'm not sure).

Btw, this works:

setFocus() {
    this.inputElement.input.focus();
  }

https://gist.run/?id=485bf6ea201c0ae0e991525c9087f397

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

No branches or pull requests

2 participants