Fix video-ccomment-add cancellation
authorRigel Kent <sendmemail@rigelk.eu>
Sun, 15 Mar 2020 15:05:37 +0000 (16:05 +0100)
committerRigel Kent <sendmemail@rigelk.eu>
Sun, 15 Mar 2020 15:05:37 +0000 (16:05 +0100)
client/src/app/videos/+video-watch/comment/video-comment-add.component.html
client/src/app/videos/+video-watch/comment/video-comment-add.component.scss
client/src/app/videos/+video-watch/comment/video-comment-add.component.ts

index 29c7a8bfa1d4ecee2bb53a05913a49f0529b4ab1..3e820041d997e8a5850c3b63379293e8a6837664 100644 (file)
@@ -17,7 +17,7 @@
   </div>
 
   <div class="comment-buttons">
-    <button *ngIf="isAddButtonDisplayed()" class="cancel-button" (click)="cancelCommentReply()" i18n>
+    <button *ngIf="isAddButtonDisplayed()" class="cancel-button" (click)="cancelCommentReply()" type="button" i18n>
       Cancel
     </button>
     <button *ngIf="isAddButtonDisplayed()" [ngClass]="{ disabled: !form.valid || addingComment }" i18n>
index c04727ba04ab70f3227a7deacf42d43371e5042a..b9e8644913399f8c8b85eb47459333ecee0ddb5d 100644 (file)
@@ -30,14 +30,6 @@ form {
   }
 }
 
-.cancel-button {
-  font-weight: $font-semibold;
-  display: inline-block;
-  padding: 0 10px 0 10px;
-  white-space: nowrap;
-  background: transparent;
-}
-
 .comment-buttons {
   display: flex;
   justify-content: flex-end;
@@ -49,6 +41,16 @@ form {
       @include orange-button;
     }
   }
+
+  .cancel-button {
+    @include tertiary-button;
+
+    font-weight: $font-semibold;
+    display: inline-block;
+    padding: 0 10px 0 10px;
+    white-space: nowrap;
+    background: transparent;
+  }
 }
 
 @media screen and (max-width: 600px) {
index a8c432653e3534454003c842661520f5636bb838..5784efcdf749a939c0a91069b5b982e022385491 100644 (file)
@@ -139,6 +139,7 @@ export class VideoCommentAddComponent extends FormReactive implements OnInit {
 
   cancelCommentReply () {
     this.cancel.emit(null)
+    this.form.value['text'] = this.textareaElement.nativeElement.value = ''
   }
 
   private addCommentReply (commentCreate: VideoCommentCreate) {