From 9eef655f7aa64019e9c6e6f1ede7f81a7ddb95d0 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 9 Feb 2022 21:27:42 +0900 Subject: [PATCH] chore(client): check textarea exists --- packages/client/src/components/post-form.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/client/src/components/post-form.vue b/packages/client/src/components/post-form.vue index 64a6478f4..656689ddc 100644 --- a/packages/client/src/components/post-form.vue +++ b/packages/client/src/components/post-form.vue @@ -341,8 +341,10 @@ function addTag(tag: string) { } function focus() { - textareaEl.focus(); - textareaEl.setSelectionRange(textareaEl.value.length, textareaEl.value.length); + if (textareaEl) { + textareaEl.focus(); + textareaEl.setSelectionRange(textareaEl.value.length, textareaEl.value.length); + } } function chooseFileFrom(ev) {