Form component #550

Merged
btzr-io merged 2 commits from btzr/enter-key into master 2017-09-19 00:17:07 +02:00
btzr-io commented 2017-09-11 03:29:23 +02:00 (Migrated from github.com)

Fixes #542

If you try to use the Enter key to send credits on the Send screen or send an invite on the Invites screen, the page reloads and nothing happens

  • Implement form component.
  • Implement submit component.
  • Fix weird behavior in wallet send.
  • Prevent refresh on enter key.
  • Submit form on enter key in Send, and Invite page.
### Fixes #542 > If you try to use the Enter key to send credits on the Send screen or send an invite on the Invites screen, the page reloads and nothing happens - Implement form component. - Implement submit component. - Fix weird behavior in wallet send. - Prevent refresh on enter key. - Submit form on enter key in `Send`, and `Invite` page.
btzr-io commented 2017-09-12 01:59:26 +02:00 (Migrated from github.com)

@kauffj any thoughts on this? 🙃

@kauffj any thoughts on this? :upside_down_face:
kauffj (Migrated from github.com) requested changes 2017-09-12 22:42:41 +02:00
kauffj (Migrated from github.com) left a comment

I'm inclined to create a Form component, what do you think of this approach? It would also then be good to replace all existing <form> tags in the app with it.

I'm inclined to create a `Form` component, what do you think of this approach? It would also then be good to replace all existing `<form>` tags in the app with it.
@ -24,4 +23,4 @@
}
render() {
const { errorMessage, isPending } = this.props;
kauffj (Migrated from github.com) commented 2017-09-12 22:40:49 +02:00

If every form needs to call event.preventDefault() to prevent enter based submission from reloading the page, maybe we should just make a Form component that takes a required submit property?

Then this component can handle preventing the event, without every individual form being required to remember to add this.

If every form needs to call `event.preventDefault()` to prevent enter based submission from reloading the page, maybe we should just make a `Form` component that takes a required submit property? Then this component can handle preventing the event, without every individual form being required to remember to add this.
kauffj (Migrated from github.com) commented 2017-09-12 22:42:00 +02:00

Why do we need this? And it should probably be button--submit if this is a specific state or type of a button.

Why do we need this? And it should probably be `button--submit` if this is a specific state or type of a button.
btzr-io (Migrated from github.com) reviewed 2017-09-13 04:57:34 +02:00
btzr-io (Migrated from github.com) commented 2017-09-13 04:57:34 +02:00

the current styles are for <a></a> and don't work with an actual <button></button> ^^

the current styles are for `<a></a>` and don't work with an actual `<button></button>` ^^
btzr-io (Migrated from github.com) reviewed 2017-09-13 05:04:06 +02:00
@ -24,4 +23,4 @@
}
render() {
const { errorMessage, isPending } = this.props;
btzr-io (Migrated from github.com) commented 2017-09-13 05:04:06 +02:00

Yeah, I should have done that... 😛
here? -> https://github.com/lbryio/lbry-app/blob/master/ui/js/component/form.js

Yeah, I should have done that... :stuck_out_tongue: here? -> https://github.com/lbryio/lbry-app/blob/master/ui/js/component/form.js
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-desktop#550
No description provided.