Skip to content

Commit

Permalink
Memberships: Automatically select + min amount (#12417)
Browse files Browse the repository at this point in the history
This change automatically preselects the new button, because you supposedly want to use the one you just created.

* Automatically select the button just added

* Add minimum amount

* Add a comment
  • Loading branch information
artpi authored May 22, 2019
1 parent 510a46b commit e4dcb10
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions extensions/blocks/membership-button/edit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ class MembershipsButtonEdit extends Component {
},
] ),
} );
// After successful adding of product, we want to select it. Presumably that is the product user wants.
this.setMembershipAmount( result.id );
},
result => {
this.setState( { addingMembershipAmount: PRODUCT_FORM } );
Expand Down Expand Up @@ -190,6 +192,7 @@ class MembershipsButtonEdit extends Component {
onChange={ this.handlePriceChange }
placeholder={ formatCurrency( 0, this.state.editedProductCurrency ) }
required
min="5.00"
step="1"
type="number"
value={ this.state.editedProductPrice || '' }
Expand Down

0 comments on commit e4dcb10

Please sign in to comment.