Search code examples
javascriptpolymer

polymer focus() on <paper-input> or <core-input> element


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.


Solution

  • core-input is missing focus()/blur() API, this is essentially a bug.

    For now you can do this:

    <reference to a core/paper-input>.$.input.focus();