From 861b317d00905023fbafc30578cca023852cfaf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Fri, 1 May 2020 12:19:08 +0200 Subject: [PATCH] Prevent letter debounce erasing when creating new answers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- src/components/Questions/AnswerInput.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/Questions/AnswerInput.vue b/src/components/Questions/AnswerInput.vue index 57a1eb87..4fa49264 100644 --- a/src/components/Questions/AnswerInput.vue +++ b/src/components/Questions/AnswerInput.vue @@ -79,6 +79,10 @@ export default { // Dispatched for creation. Marked as synced this.answer.local = false const newAnswer = await this.debounceCreateAnswer(answer) + + // Forward changes, but use current answer.text to avoid erasing + // any in-between changes while creating the answer + Object.assign(newAnswer, { text: this.$refs.input.value }) this.$emit('update:answer', answer.id, newAnswer) } else { this.debounceUpdateAnswer(answer)