Commit c0717e70a0bf23708dbf084f690bb13b60634231

Authored by Vladyslav_Prykhodko
Committed by Andrew Shvayka
1 parent 910d90b9

UI: Fixed focus in toggle-password button after push enter button

... ... @@ -15,6 +15,6 @@
15 15 limitations under the License.
16 16
17 17 -->
18   -<button mat-icon-button (click)="togglePassword($event)" [attr.aria-pressed]="showPassword" *ngIf="!hideToggle">
  18 +<button mat-icon-button type="button" (click)="togglePassword($event)" [attr.aria-pressed]="showPassword" *ngIf="!hideToggle">
19 19 <mat-icon>{{ showPassword ? 'visibility' : 'visibility_off' }}</mat-icon>
20 20 </button>
... ...
... ... @@ -24,13 +24,13 @@ import { AfterViewInit, Component, ElementRef } from '@angular/core';
24 24 export class TogglePasswordComponent implements AfterViewInit {
25 25 showPassword = false;
26 26 hideToggle = false;
  27 +
27 28 private input: HTMLInputElement = null;
28 29
29 30 constructor(private hostElement: ElementRef) { }
30 31
31 32 togglePassword($event: Event) {
32 33 $event.stopPropagation();
33   - $event.preventDefault();
34 34 this.showPassword = !this.showPassword;
35 35 this.input.type = this.showPassword ? 'text' : 'password';
36 36 }
... ...