]> cat aescling's git repositories - mastodon.git/commitdiff
fix(features/compose): Handle external changes to the textarea (#3632)
authorSorin Davidoi <sorin.davidoi@gmail.com>
Sun, 25 Jun 2017 19:43:27 +0000 (21:43 +0200)
committerEugen Rochko <eugen@zeonfederated.com>
Sun, 25 Jun 2017 19:43:27 +0000 (21:43 +0200)
app/javascript/mastodon/features/compose/components/compose_form.js

index c379c1855a4e2e886010c90687d405b3845a4970..f7eeedc69f70c71bed581e5127e9148d464ef6e9 100644 (file)
@@ -67,6 +67,12 @@ export default class ComposeForm extends ImmutablePureComponent {
   }
 
   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();
   }