-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reset textarea height when press submit key #2681
Conversation
@@ -44,12 +44,13 @@ class ComposeForm extends React.PureComponent { | |||
|
|||
handleKeyDown (e) { | |||
if (e.keyCode === 13 && (e.ctrlKey || e.metaKey)) { | |||
this.autosuggestTextarea.reset(); | |||
this.props.onSubmit(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could call handleSubmit
here for a little DRYer code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it like this? 777336d
@@ -44,12 +44,12 @@ class ComposeForm extends React.PureComponent { | |||
|
|||
handleKeyDown (e) { | |||
if (e.keyCode === 13 && (e.ctrlKey || e.metaKey)) { | |||
this.props.onSubmit(); | |||
this.props.handleSubmit(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this isn't a prop! just this.handleSubmit()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I seem to be tired.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
974ab5f I'm sorry. I fixed it...
…upstream Merge upstream changes up to d702a03
ref #2236