Fixed programatically inserting comments

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2021-05-02 20:41:23 +02:00
parent 5afdd80c71
commit 73ed0f5e34
3 changed files with 26 additions and 12 deletions

View File

@@ -212,6 +212,7 @@ export default class Comment extends Vue {
// See https://github.com/kaorun343/vue-property-decorator/issues/257
@Ref() readonly commentEditor!: EditorComponent & {
replyToComment: (comment: IComment) => void;
focus: () => void;
};
currentActor!: IPerson;
@@ -242,6 +243,11 @@ export default class Comment extends Vue {
return;
}
this.replyTo = true;
if (this.comment.actor) {
this.commentEditor.replyToComment(this.comment.actor);
await this.$nextTick; // wait for the mention to be injected
this.commentEditor.focus();
}
}
replyToComment(): void {