title: Disable Chrome's "Update Password" prompt *only when canceling a password change*
body: <p>I've seen many posts about disabling Update Password prompts, but these are all about completely disabling autocomplete of passwords.</p>
  <p>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.</p>
  <p>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.</p>
  <p>Any ideas? Here are the relevant parts of the dialog HTML:</p>
  <pre><code>
    &lt;mat-form-field appearance=&quot;fill&quot; &gt;
      &lt;mat-label&gt;Username&lt;/mat-label&gt;
      &lt;input matInput [ngModel]=&quot;userName&quot; disabled&gt;
    &lt;/mat-form-field&gt;
  
    &lt;mat-form-field appearance=&quot;fill&quot;&gt;
      &lt;mat-label&gt;Current Password&lt;/mat-label&gt;
      &lt;input matInput type=&quot;password&quot; [(ngModel)]=&quot;currentPassword&quot; (input)=&quot;onInput()&quot; (focus)=&quot;onFocus('curr')&quot; (blur)=&quot;onBlur('curr')&quot;
          [errorStateMatcher]=&quot;esm('currentPassword')&quot;&gt;
    &lt;/mat-form-field&gt;
  
    &lt;mat-form-field appearance=&quot;fill&quot;&gt;
      &lt;mat-label&gt;New Password&lt;/mat-label&gt;
      &lt;input matInput [(ngModel)]=&quot;newPassword&quot; type=&quot;password&quot; (input)=&quot;onInput()&quot; (focus)=&quot;onFocus('new')&quot; (blur)=&quot;onBlur('new')&quot;
          [errorStateMatcher]=&quot;esm('newPassword')&quot;&gt;
    &lt;/mat-form-field&gt;
  
    &lt;mat-form-field appearance=&quot;fill&quot;&gt;
      &lt;mat-label&gt;Confirm New Password&lt;/mat-label&gt;
      &lt;input matInput [(ngModel)]=&quot;confirmPassword&quot; type=&quot;password&quot; (input)=&quot;onInput()&quot; (focus)=&quot;onFocus('conf')&quot; (blur)=&quot;onBlur('conf')&quot;
          [errorStateMatcher]=&quot;esm('confirmPassword')&quot;&gt;
    &lt;/mat-form-field&gt;
  
    &lt;mat-dialog-actions fxLayout=&quot;row&quot; fxLayoutGap=&quot;8px&quot; fxLayoutAlign=&quot;center center&quot;&gt;
      &lt;button mat-stroked-button type=&quot;button&quot; class=&quot;cancel-btn&quot; (click)=&quot;onCancel()&quot;&gt;CANCEL&lt;/button&gt;
  
      &lt;button mat-flat-button type=&quot;submit&quot; class=&quot;submit-btn&quot; ngbAutofocus (click)=&quot;onSubmit()&quot;
          [disabled]=&quot;!valid || processing&quot; [style.opacity]=&quot;!valid || processing ? '0.33' : '1'&quot;&gt;
        SUBMIT&lt;app-spinner-overlay [processing]=&quot;processing&quot;&gt;&lt;/app-spinner-overlay&gt;
      &lt;/button&gt;
    &lt;/mat-dialog-actions&gt;
  </code></pre>