+
+ if (this.focusOnInit === true) {
+ this.textareaElement.nativeElement.focus()
+ }
+
+ if (this.parentComment) {
+ const mentions = this.parentComments
+ .filter(c => c.account.id !== this.user.account.id) // Don't add mention of ourselves
+ .map(c => '@' + c.by)
+
+ const mentionsSet = new Set(mentions)
+ const mentionsText = Array.from(mentionsSet).join(' ') + ' '
+
+ this.form.patchValue({ text: mentionsText })
+ }
+ }
+
+ onValidKey () {
+ this.onValueChanged()
+ if (!this.form.valid) return
+
+ this.formValidated()