diff --git a/app/javascript/shared/components/ResizableTextArea.vue b/app/javascript/shared/components/ResizableTextArea.vue index bc7c89dc0..083632858 100644 --- a/app/javascript/shared/components/ResizableTextArea.vue +++ b/app/javascript/shared/components/ResizableTextArea.vue @@ -113,7 +113,6 @@ export default { }); }, setCursor() { - const textarea = this.$refs.textarea; const bodyWithoutSignature = removeSignature( this.value, this.cleanedSignature @@ -121,9 +120,12 @@ export default { // only trim at end, so if there are spaces at the start, those are not removed const bodyEndsAt = bodyWithoutSignature.trimEnd().length; + const textarea = this.$refs.textarea; - textarea.focus(); - textarea.setSelectionRange(bodyEndsAt, bodyEndsAt); + if (textarea) { + textarea.focus(); + textarea.setSelectionRange(bodyEndsAt, bodyEndsAt); + } }, onInput(event) { this.$emit('input', event.target.value);