core-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]));
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…