Skip to content
This repository has been archived by the owner on Sep 27, 2019. It is now read-only.

Commit

Permalink
Merge branch 'master' into issue/fix-contract-form-bytes32-submit
Browse files Browse the repository at this point in the history
  • Loading branch information
maxme committed Feb 19, 2019
2 parents 2036e6f + f411823 commit 249b88a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/ContractForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ class ContractForm extends Component {
this.state = initialState;
}

handleSubmit() {
handleSubmit(event) {
event.preventDefault();

const convertedInputs = this.inputs.map((input, index) => {
if (input.type === 'bytes32') {
return this.utils.toHex(this.state[input.name])
Expand Down Expand Up @@ -72,7 +74,7 @@ class ContractForm extends Component {

render() {
return (
<form className="pure-form pure-form-stacked">
<form className="pure-form pure-form-stacked" onSubmit={this.handleSubmit}>
{this.inputs.map((input, index) => {
var inputType = this.translateType(input.type);
var inputLabel = this.props.labels
Expand Down
6 changes: 4 additions & 2 deletions src/new-context-api/ContractForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ class ContractForm extends Component {
this.state = initialState;
}

handleSubmit() {
handleSubmit(event) {
event.preventDefault();

const convertedInputs = this.inputs.map((input, index) => {
if (input.type === 'bytes32') {
return this.utils.toHex(this.state[input.name])
Expand Down Expand Up @@ -70,7 +72,7 @@ class ContractForm extends Component {

render() {
return (
<form className="pure-form pure-form-stacked">
<form className="pure-form pure-form-stacked" onSubmit={this.handleSubmit}>
{this.inputs.map((input, index) => {
var inputType = this.translateType(input.type);
var inputLabel = this.props.labels
Expand Down

0 comments on commit 249b88a

Please sign in to comment.