Disable Chrome's "Update Password" prompt *only when canceling a password change*

Viewed 24

I've seen many posts about disabling Update Password prompts, but these are all about completely disabling autocomplete of passwords.

What I want to do is conditionally prevent Update Password prompts, specifically when I click Cancel in a change-password dialog. After all, if you decide you want to cancel doing a password change, you wouldn't want to update your web browser with the change you decided not to make.

I've tried a like having the cancel button empty all password fields (original, new, confirmed new), any changing the input type of password fields from password to hidden, but that doesn't help. I think the browser's decision to offer the Update Password happens sooner than any of my attempts to defeat it can kick in.

Any ideas? Here are the relevant parts of the dialog HTML:


  <mat-form-field appearance="fill" >
    <mat-label>Username</mat-label>
    <input matInput [ngModel]="userName" disabled>
  </mat-form-field>

  <mat-form-field appearance="fill">
    <mat-label>Current Password</mat-label>
    <input matInput type="password" [(ngModel)]="currentPassword" (input)="onInput()" (focus)="onFocus('curr')" (blur)="onBlur('curr')"
        [errorStateMatcher]="esm('currentPassword')">
  </mat-form-field>

  <mat-form-field appearance="fill">
    <mat-label>New Password</mat-label>
    <input matInput [(ngModel)]="newPassword" type="password" (input)="onInput()" (focus)="onFocus('new')" (blur)="onBlur('new')"
        [errorStateMatcher]="esm('newPassword')">
  </mat-form-field>

  <mat-form-field appearance="fill">
    <mat-label>Confirm New Password</mat-label>
    <input matInput [(ngModel)]="confirmPassword" type="password" (input)="onInput()" (focus)="onFocus('conf')" (blur)="onBlur('conf')"
        [errorStateMatcher]="esm('confirmPassword')">
  </mat-form-field>

  <mat-dialog-actions fxLayout="row" fxLayoutGap="8px" fxLayoutAlign="center center">
    <button mat-stroked-button type="button" class="cancel-btn" (click)="onCancel()">CANCEL</button>

    <button mat-flat-button type="submit" class="submit-btn" ngbAutofocus (click)="onSubmit()"
        [disabled]="!valid || processing" [style.opacity]="!valid || processing ? '0.33' : '1'">
      SUBMIT<app-spinner-overlay [processing]="processing"></app-spinner-overlay>
    </button>
  </mat-dialog-actions>
1 Answers

It has to do with the type of the input field. It should be changed to "text" instead but this makes things a bit trickier.

This might help.

Related