Search code examples
mudblazormudtextfield

MudTextField How do I prevent autofill?


I have two MudTextFields that are getting autofilled from the browser password store. Neither of the fields have anything to do with login. How can I prevent ANY form of autofill for both of them?

This is what I get: enter image description here

Here are the field definitions:

<MudTextField @bind-Value="CompanyName" Label="Firma" Variant="Variant.Text"></MudTextField>
<MudTextField @bind-Value="EncryptionSecret" Label="Krypteringsnøkkel" Variant="Variant.Text" InputType="InputType.Password" />

Solution

  • I figured it out:

    autocomplete="new-email" and autocomplete="new-password" both work.

    <MudTextField @bind-Value="CompanyName" Label="Firma" Variant="Variant.Text" autocomplete="new-email"></MudTextField>
    
    <MudTextField @bind-Value="EncryptionSecret" Label="Krypteringsnøkkel" Variant="Variant.Text" InputType="InputType.Password" autocomplete="new-password" />