diff --git a/templates/demo/app/components/ens.js b/templates/demo/app/components/ens.js index 0167bfcdc..e2219ad17 100644 --- a/templates/demo/app/components/ens.js +++ b/templates/demo/app/components/ens.js @@ -43,6 +43,14 @@ class ENS extends React.Component { this.setState({ [stateName]: e.target.value }); } + checkEnter(e, func) { + if (e.key !== 'Enter') { + return; + } + e.preventDefault(); + func.apply(this, [e]); + } + registerSubDomain(e) { e.preventDefault(); const self = this; @@ -109,7 +117,7 @@ class ENS extends React.Component { return ( {this.state.globalError && {this.state.globalError}}

Resolve a name

-
+ this.checkEnter(e, this.resolveName)}> {this.state.responseResolve && @@ -124,7 +132,7 @@ class ENS extends React.Component {

Lookup an address

-
+ this.checkEnter(e, this.lookupAddress)}> {this.state.responseLookup && @@ -139,7 +147,7 @@ class ENS extends React.Component {

Register subdomain for embark

-
+ this.checkEnter(e, this.registerSubDomain)}> {this.state.responseRegister &&