logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe
commit: 4ce154009426038f0bb88d2e89b408ade928b1a2
parent: 67243bda3157a9046148b41579f0b1e8cf4a7116
Author: Sorin Davidoi <sorin.davidoi@gmail.com>
Date:   Sun, 25 Jun 2017 21:43:27 +0200

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


Diffstat:

Mapp/javascript/mastodon/features/compose/components/compose_form.js6++++++
1 file 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 @@ -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(); }