diff options
Diffstat (limited to 'client/src/app/+videos')
-rw-r--r-- | client/src/app/+videos/+video-watch/comment/video-comment-add.component.ts | 4 | ||||
-rw-r--r-- | client/src/app/+videos/+video-watch/comment/video-comments.component.ts | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/client/src/app/+videos/+video-watch/comment/video-comment-add.component.ts b/client/src/app/+videos/+video-watch/comment/video-comment-add.component.ts index c1d0032cc..d746a614b 100644 --- a/client/src/app/+videos/+video-watch/comment/video-comment-add.component.ts +++ b/client/src/app/+videos/+video-watch/comment/video-comment-add.component.ts | |||
@@ -183,7 +183,11 @@ export class VideoCommentAddComponent extends FormReactive implements OnChanges, | |||
183 | this.textareaElement.nativeElement.focus() | 183 | this.textareaElement.nativeElement.focus() |
184 | } | 184 | } |
185 | 185 | ||
186 | // Scroll to textarea | ||
186 | this.textareaElement.nativeElement.scrollIntoView({ behavior: 'smooth', block: 'center', inline: 'nearest' }) | 187 | this.textareaElement.nativeElement.scrollIntoView({ behavior: 'smooth', block: 'center', inline: 'nearest' }) |
188 | |||
189 | // Use the native textarea autosize according to the text's break lines | ||
190 | this.textareaElement.nativeElement.dispatchEvent(new Event('input')) | ||
187 | }) | 191 | }) |
188 | 192 | ||
189 | this.form.patchValue({ text }) | 193 | this.form.patchValue({ text }) |
diff --git a/client/src/app/+videos/+video-watch/comment/video-comments.component.ts b/client/src/app/+videos/+video-watch/comment/video-comments.component.ts index 79627b1af..602bd8050 100644 --- a/client/src/app/+videos/+video-watch/comment/video-comments.component.ts +++ b/client/src/app/+videos/+video-watch/comment/video-comments.component.ts | |||
@@ -199,10 +199,13 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { | |||
199 | if (confirm) { | 199 | if (confirm) { |
200 | this.inReplyToCommentId = commentToRedraft.inReplyToCommentId | 200 | this.inReplyToCommentId = commentToRedraft.inReplyToCommentId |
201 | 201 | ||
202 | // Display <br /> tag as a break line for editing | ||
203 | const commentToRedraftText = commentToRedraft.text.replace(/<br.?\/?>/g, '\r\n') | ||
204 | |||
202 | if (commentToRedraft.threadId === commentToRedraft.id) { | 205 | if (commentToRedraft.threadId === commentToRedraft.id) { |
203 | this.commentThreadRedraftValue = commentToRedraft.text | 206 | this.commentThreadRedraftValue = commentToRedraftText |
204 | } else { | 207 | } else { |
205 | this.commentReplyRedraftValue = commentToRedraft.text | 208 | this.commentReplyRedraftValue = commentToRedraftText |
206 | } | 209 | } |
207 | 210 | ||
208 | } | 211 | } |