Client: fix form upload validation on key enter
authorChocobozzz <florian.bigard@gmail.com>
Mon, 17 Oct 2016 19:14:13 +0000 (21:14 +0200)
committerChocobozzz <florian.bigard@gmail.com>
Mon, 17 Oct 2016 19:14:13 +0000 (21:14 +0200)
client/src/app/videos/video-add/video-add.component.html
client/src/app/videos/video-add/video-add.component.ts

index 64320cae7dc5885ef7a9831ba34a54c2beed2ace..14c7a0136534d118e469429d61e309bc46d38448 100644 (file)
@@ -2,7 +2,7 @@
 
 <div *ngIf="error" class="alert alert-danger">{{ error }}</div>
 
-<form novalidate (ngSubmit)="upload()" [formGroup]="form">
+<form novalidate [formGroup]="form">
   <div class="form-group">
     <label for="name">Name</label>
     <input
@@ -68,8 +68,9 @@
 
   <div class="form-group">
     <input
-      type="submit" value="Upload" class="btn btn-default form-control" [title]="getInvalidFieldsTitle()"
-      [disabled]="!form.valid || tags.length === 0 || filename === null"
+      type="button" value="Upload" class="btn btn-default form-control"
+      [title]="getInvalidFieldsTitle()" [disabled]="!form.valid || tags.length === 0 || filename === null"
+      (click)="upload()"
     >
   </div>
 </form>
index 0a8b8293b914f31a264ebd649ebedeed7dc9ed11..b7bf1534f9ee13b5c6c446d1b3e423e60f10537d 100644 (file)
@@ -130,6 +130,7 @@ export class VideoAddComponent extends FormReactive implements OnInit {
 
   removeTag(tag: string) {
     this.tags.splice(this.tags.indexOf(tag), 1);
+    this.form.get('currentTag').enable();
   }
 
   upload() {