From 6bbb245a3dc6585e3baddb641ac14172f2d9e041 Mon Sep 17 00:00:00 2001 From: Steven Bontenbal Date: Sat, 27 Jan 2024 18:31:56 +0100 Subject: [PATCH] Fix cancel on edit issue --- frontend/src/components/Song.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/Song.vue b/frontend/src/components/Song.vue index 4785530..3aca525 100644 --- a/frontend/src/components/Song.vue +++ b/frontend/src/components/Song.vue @@ -214,7 +214,7 @@ import ScoreComponent from "@/components/Score.vue" import VueMultiselect from 'vue-multiselect' import { useEditor, EditorContent } from '@tiptap/vue-3' import StarterKit from '@tiptap/starter-kit' -import { computed, onMounted, ref } from 'vue' +import { computed, onMounted, ref, toRaw } from 'vue' import { useVuelidate } from '@vuelidate/core'; import { required } from '@vuelidate/validators'; import { useSongs } from "@/stores/songStore"; @@ -358,7 +358,7 @@ const remove = () => }); const edit = () => { - draftValues.value = song.value as DraftSong; + draftValues.value = structuredClone(toRaw(song.value as DraftSong)) draftValues.value.songbook ??= {} draftSongCategories.value = Object.assign({}, songCategories.value); editing.value = true;