Skip to content
Snippets Groups Projects
Verified Commit b434ccae authored by Alex ORLUC's avatar Alex ORLUC
Browse files

FEAT #10432 TIME 1 fix autofill (ios bug)

parent abdab162
No related branches found
No related tags found
No related merge requests found
......@@ -3,10 +3,10 @@
<mat-card class="login-form" *ngIf="!loadingForm" [@myAnimation]>
<form (ngSubmit)="login()">
<mat-form-field class="input-row">
<input name="login" matInput placeholder="{{'lang.login' | translate}}" [(ngModel)]="newLogin.login" type="text" oninput="this.value = this.value.toLowerCase()">
<input id="login" name="login" matInput placeholder="{{'lang.login' | translate}}" [(ngModel)]="newLogin.login" type="text" oninput="this.value = this.value.toLowerCase()" (click)="fixAutoFill()">
</mat-form-field>
<mat-form-field class="input-row">
<input name="password" matInput placeholder="{{'lang.password' | translate}}" type="password" [(ngModel)]="newLogin.password">
<input id="password" name="password" matInput placeholder="{{'lang.password' | translate}}" type="password" [(ngModel)]="newLogin.password">
<mat-hint align="end"><a routerLink="/forgot-password" class="forgotPwdLink">{{'lang.forgotPassword' | translate}} ?</a></mat-hint>
</mat-form-field>
<button type="submit" mat-button [disabled]="newLogin.id == '' || newLogin.password == '' || loadingConnexion">{{labelButton | translate}}</button>
......
......@@ -9,6 +9,8 @@ import { CookieService } from 'ngx-cookie-service';
import { NotificationService } from '../service/notification.service';
import { environment } from '../../core/environments/environment';
import { TranslateService } from '@ngx-translate/core';
import { Validators, FormControl } from '@angular/forms';
import { last } from '@angular/router/src/utils/collection';
@Component({
templateUrl: 'login.component.html',
......@@ -34,15 +36,18 @@ import { TranslateService } from '@ngx-translate/core';
})
export class LoginComponent implements OnInit, AfterViewInit {
loadingForm : boolean = true;
loadingConnexion : boolean = false;
newLogin : any = {
login : '',
password : ''
loadingForm: boolean = true;
loadingConnexion: boolean = false;
newLogin: any = {
login: '',
password: ''
};
labelButton : string = 'lang.connect';
appVersion : string = '';
appAuthor : string = '';
labelButton: string = 'lang.connect';
appVersion: string = '';
appAuthor: string = '';
idMail = new FormControl('', [Validators.required]);
password = new FormControl('', [Validators.required]);
constructor(private translate: TranslateService, public http: HttpClient, private cookieService: CookieService, private router: Router, iconReg: MatIconRegistry, sanitizer: DomSanitizer, public signaturesService: SignaturesContentService, public notificationService: NotificationService) {
iconReg.addSvgIcon('maarchLogo', sanitizer.bypassSecurityTrustResourceUrl('../src/frontend/assets/logo_white.svg'));
......@@ -63,6 +68,7 @@ export class LoginComponent implements OnInit, AfterViewInit {
}, 200);
setTimeout(() => {
this.loadingForm = false;
this.fixAutoFill();
}, 500);
}
......@@ -91,4 +97,11 @@ export class LoginComponent implements OnInit, AfterViewInit {
this.loadingConnexion = false;
});
}
fixAutoFill() {
setTimeout(() => {
this.newLogin.login = $('#login').val();
this.newLogin.password = $('#password').val();
}, 100);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment