javascript - Setting focus after opening dialog - Polymer (no JQuery) -
how 1 place focus on paper-input
contained within paper-dialog
@ point of being opened?
i have basic code proof of concept, won't have focus.
i have found works autofocus
written in paper-input
don't think appropriate method.
html
<paper-dialog style="margin:0; padding: 0;" class="changepicturedialog" id="dialog" with-backdrop entry-animation="scale-up-animation" exit-animation="fade-out-animation"> <paper-input style="margin:20px" id="newinput" placeholder="placeholder"></paper-input> <paper-button id="button" on-click="focusinput">button</paper-button> </paper-dialog>
js
opendialog : function() { this.$.dialog.open(); this.$.newinput.focus(); },
change this:
this.$.newinput.focus();
to:
this.$.newinput.autofocus = true;
Comments
Post a Comment