Skip to content
Snippets Groups Projects
Commit 0ec69149 authored by Lukas Mauß's avatar Lukas Mauß Committed by Tom Käsler
Browse files

Check max-length of session-input

parent 67880746
No related merge requests found
......@@ -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>
......
......@@ -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();
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment