Browse Source

fix(features/compose): Handle external changes to the textarea (#3632)

master
Sorin Davidoi 7 years ago
committed by Eugen Rochko
parent
commit
4ce1540094
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      app/javascript/mastodon/features/compose/components/compose_form.js

+ 6
- 0
app/javascript/mastodon/features/compose/components/compose_form.js View File

@ -67,6 +67,12 @@ export default class ComposeForm extends ImmutablePureComponent {
} }
handleSubmit = () => { handleSubmit = () => {
if (this.props.text !== this.autosuggestTextarea.textarea.value) {
// Something changed the text inside the textarea (e.g. browser extensions like Grammarly)
// Update the state to match the current text
this.props.onChange(this.autosuggestTextarea.textarea.value);
}
this.props.onSubmit(); this.props.onSubmit();
} }

Loading…
Cancel
Save