I have several input elements from polymer paper in a polymer application. When one of these elements is focused, I would like the text input of the input to be highlighted ( for example, so ), so that if the user is just starting to type, the existing input value is overwritten.
Is there a way to programmatically highlight text?
I get it.
inputElement.$.input.select()
It would be nice if it was registered somewhere.
, inputElement HTML, <paper-input>. , select() <paper-input>.
inputElement
<paper-input>
select()
HTML:
<paper-input id="my-input" value="[[myInputText]]></paper-input>
JavaScript:
querySelector('#my-input').inputElement.select();