diff --git a/src/app/components/shared/room-join/room-join.component.html b/src/app/components/shared/room-join/room-join.component.html index dfc450fe419368dd24826b59e5443cbe5348aaa9..eba6c03f211d83f73179a794e1b918315bb241c6 100644 --- a/src/app/components/shared/room-join/room-join.component.html +++ b/src/app/components/shared/room-join/room-join.component.html @@ -2,7 +2,7 @@ <form (ngSubmit)="joinRoom(roomId.value)"> <div fxLayout="row" fxLayoutAlign="center" fxLayoutGap="10px"> <mat-form-field> - <input matInput #roomId type="number" placeholder="Session-Id" [formControl]="roomFormControl" + <input matInput #roomId type="number" onkeydown="if(this.value.length === 8) return false;" placeholder="Session-Id" [formControl]="roomFormControl" [errorStateMatcher]="matcher"/> <mat-hint align="end">{{roomId.value.split(' ').join(' ').length}} / 8</mat-hint> <mat-error *ngIf="roomFormControl.hasError('required')">{{ 'home-page.please-enter' | translate}}</mat-error> diff --git a/src/app/components/shared/room-join/room-join.component.ts b/src/app/components/shared/room-join/room-join.component.ts index a7a0fb4cfb4b31555be09ff691ea1f0d07b7b406..cc22283e5b55b9b58b70088dbb214c44bdeadc4a 100644 --- a/src/app/components/shared/room-join/room-join.component.ts +++ b/src/app/components/shared/room-join/room-join.component.ts @@ -29,7 +29,7 @@ export class RoomJoinComponent implements OnInit { room: Room; demoId = '95680586'; user: User; - + roomFormControl = new FormControl('', [Validators.required, Validators.minLength(8), Validators.maxLength(8)]); matcher = new RegisterErrorStateMatcher();