mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Fix error messages position
This commit is contained in:
@@ -18,8 +18,7 @@
|
||||
<span id="username-error" class="mdl-textfield__error" style="visibility: visible" data-automation-id="username-error">{{formError.username | translate }}</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div [ngClass]="{'is-invalid': isErrorStyle(form.controls.password)}"
|
||||
<div
|
||||
class="center mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
|
||||
<i [ngClass]="{hide: isPasswordShow}" [ngClass]="{show: !isPasswordShow}" (click)="toggleShowPassword()" data-automation-id="show_password"
|
||||
class="icon-inline">
|
||||
@@ -35,7 +34,7 @@
|
||||
</i>
|
||||
<label for="password" class="mdl-textfield__label">{{'LOGIN.LABEL.PASSWORD' | translate }}</label>
|
||||
<input type="password" class="mdl-textfield__input" id="password" data-automation-id="password" ngControl="password" tabindex="2" />
|
||||
<span class="mdl-tooltip--validation is-active" for="password" *ngIf="formError.password">
|
||||
<span class="mdl-tooltip--validation" for="password" *ngIf="formError.password">
|
||||
<span id="password-required" class="mdl-textfield__error" style="visibility: visible" data-automation-id="password-required">{{formError.password | translate }}</span>
|
||||
</span>
|
||||
</div>
|
||||
|
@@ -89,7 +89,7 @@ export class AlfrescoLoginComponent {
|
||||
|
||||
this.form.valueChanges.subscribe(data => this.onValueChanged(data));
|
||||
|
||||
this.onValueChanged(null);
|
||||
// this.onValueChanged(null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -131,7 +131,8 @@ export class AlfrescoLoginComponent {
|
||||
for (let field in this.formError) {
|
||||
if (field) {
|
||||
this.formError[field] = '';
|
||||
let hasError = this.form.controls[field].errors || (this.form.controls[field].dirty && !this.form.controls[field].valid);
|
||||
let hasError = (this.form.controls[field].errors && !this.form.controls[field].pristine) ||
|
||||
(this.form.controls[field].dirty && !this.form.controls[field].valid);
|
||||
if (hasError) {
|
||||
for (let key in this.form.controls[field].errors) {
|
||||
if (key) {
|
||||
@@ -164,6 +165,6 @@ export class AlfrescoLoginComponent {
|
||||
if (typeof componentHandler !== 'undefined') {
|
||||
componentHandler.upgradeAllRegistered();
|
||||
}
|
||||
return !field.valid;
|
||||
return !field.valid && field.dirty && !field.pristine;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user