From fff82e7148bcfa3c3e3eef2ed37a312549a5f48c Mon Sep 17 00:00:00 2001
From: Jan-Hendrik Willms <tleilax+studip@gmail.com>
Date: Mon, 5 Jun 2023 15:15:23 +0000
Subject: [PATCH] don't lose the toolbar, fixes #2373

Closes #2373

Merge request studip/studip!1824
---
 .../vue/components/TextareaWithToolbar.vue      | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/resources/vue/components/TextareaWithToolbar.vue b/resources/vue/components/TextareaWithToolbar.vue
index 1f19864a54a..498c5d18eec 100644
--- a/resources/vue/components/TextareaWithToolbar.vue
+++ b/resources/vue/components/TextareaWithToolbar.vue
@@ -1,17 +1,30 @@
 <template>
-    <textarea :name="name" ref="textarea"
-              v-bind="$attrs" v-on="$listeners"></textarea>
+    <textarea :name="name"
+              ref="textarea"
+              v-model="content"
+    ></textarea>
 </template>
 
 <script>
 export default {
     name: 'textarea-with-toolbar',
     props: {
+        value: String,
         name: {
             type: String,
             required: false
         }
     },
+    computed: {
+        content: {
+            get() {
+                return this.value;
+            },
+            set(newContent) {
+                this.$emit('input', newContent);
+            }
+        }
+    },
     mounted () {
         $(this.$refs.textarea).addToolbar();
     }
-- 
GitLab