From 2b1ab274fecdba3582f59ced6caacd4cba8f21e9 Mon Sep 17 00:00:00 2001 From: Sorin Davidoi Date: Sun, 25 Jun 2017 21:43:27 +0200 Subject: [PATCH] fix(features/compose): Handle external changes to the textarea (#3632) --- .../mastodon/features/compose/components/compose_form.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/javascript/mastodon/features/compose/components/compose_form.js b/app/javascript/mastodon/features/compose/components/compose_form.js index c379c1855a..f7eeedc69f 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(); }