Skip to content

Commit

Permalink
fix: focus the input in a dialog with input
Browse files Browse the repository at this point in the history
Resolves #252.
  • Loading branch information
greatislander committed Feb 19, 2020
1 parent 91f28bf commit c220f9b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/assets/scripts/Pinecone/Dialog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,11 @@ class Dialog {
document.body.appendChild( overlay );
document.body.appendChild( dialog );

dismiss.focus();

if ( this.config.input ) {
document.getElementById( this.config.input ).focus();
} else {
dismiss.focus();
}

confirm.onclick = () => {
const input = ( document.getElementById( this.config.input ) ) ? document.getElementById( this.config.input ).value : false;
Expand Down

0 comments on commit c220f9b

Please sign in to comment.