Is there a way to focus core-input or paper-input element?
What I want to achieve is: set cursor to input element so user can start typing.
This way he will not be forced to click on element before writing.
See Question&Answers more detail:osIs there a way to focus core-input or paper-input element?
What I want to achieve is: set cursor to input element so user can start typing.
This way he will not be forced to click on element before writing.
See Question&Answers more detail:oscore-input has now a .focus()
method it's delegating to the internal 's focus()
From the core-input.html
code:
focus: function() {
this.$.input.focus();
}
What means that in your own code you need to call it like following:
elem[0].focus()
In my own case, I am calling focus
from a timeout
. In this case a bind
is necessary for core-input
to make a right use of this
:
$timeout(elem[0].focus.bind(elem[0]));