+
+
0 && this.content !== this.initialContent
@@ -118,6 +131,19 @@ export default defineComponent({
textarea.$el.querySelector('textarea').focus()
}
},
+
+ updateTextareaRef(): void {
+ const textarea = this.$refs.textarea as any
+ if (textarea?.$el?.querySelector('textarea')) {
+ this.textareaElement = textarea.$el.querySelector('textarea')
+ }
+ },
+
+ handleBBCodeInsert(data: { text: string; cursorPos: number }): void {
+ // Update the content with the new text
+ this.content = data.text
+ // The cursor position is handled by the BBCodeToolbar component
+ },
},
})
diff --git a/src/components/PostReplyForm.vue b/src/components/PostReplyForm.vue
index 9c63acc..6e54a02 100644
--- a/src/components/PostReplyForm.vue
+++ b/src/components/PostReplyForm.vue
@@ -9,16 +9,19 @@