about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSorin Davidoi <sorin.davidoi@gmail.com>2017-06-25 21:43:27 +0200
committerEugen Rochko <eugen@zeonfederated.com>2017-06-25 21:43:27 +0200
commit4ce154009426038f0bb88d2e89b408ade928b1a2 (patch)
treecab6b027fd0c2ee439d4b7d6fbde5a734c38b03e
parent67243bda3157a9046148b41579f0b1e8cf4a7116 (diff)
fix(features/compose): Handle external changes to the textarea (#3632)
-rw-r--r--app/javascript/mastodon/features/compose/components/compose_form.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/javascript/mastodon/features/compose/components/compose_form.js b/app/javascript/mastodon/features/compose/components/compose_form.js
index c379c1855..f7eeedc69 100644
--- a/app/javascript/mastodon/features/compose/components/compose_form.js
+++ b/app/javascript/mastodon/features/compose/components/compose_form.js
@@ -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();
   }