Description
Changes proposed in this Pull Request
This PR improves the UX for the “Submit website Address” input form by allowing the form to be submitted by pressing the enter key.
Implementation notes:
- Removed the
onUrlSubmit()
off of the <Button onClick={ onUrlSubmit }>
event and instead assigned it to the <Form onSubmit={ onUrlSubmit }>
event. This captures the Form tags natural ability to submit the form using the Enter key, if you want.
- Also made the submit button text dynamic. When submitting, button text is, “Saving…”, otherwise button text is, “Continue”.
Testing instructions
- Checkout and run this PR
- Go to http://calypso.localhost:3000/checkout/jetpack/jetpack_scan
- Complete siteless checkout.
- On the “Thank you” page, test the “Submit website address” form:
- Verify you can submit the form using the enter key or by pressing the button.
- Verify that when the form is submitting, the button text changes to, “Saving…”, otherwise it says, “Continue”.
Unfortunately, no screenshots were provided by the developer.