Skip to content
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

Merged
merged 3 commits into from
May 2, 2017
Merged

Reset textarea height when press submit key #2681

merged 3 commits into from
May 2, 2017

Conversation

ykzts
Copy link
Member

@ykzts ykzts commented May 1, 2017

ref #2236

@@ -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();
Copy link
Contributor

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.

Copy link
Member Author

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();
Copy link
Member

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()

Copy link
Member Author

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.

Copy link
Member Author

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...

@Gargron Gargron merged commit 46943b6 into mastodon:master May 2, 2017
@ykzts ykzts deleted the reset branch May 3, 2017 00:39
tribela pushed a commit to tribela/mastodon that referenced this pull request Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants