How do I disable list of suggested password shown in an `<InputText type="password">` field used in a razor component for all browsers

Viewed 1614

I am creating a razor component and it has following field

<InputText type="password" class="form-control" placeholder="New Password" name="password" id="newPw" autocomplete="off" />

When the build is executed and run in Chrome. I see a list of suggested passwords. I don't want this list to be shown. The image is given below

Image of list of password being shown

How can I disable this? In autocomplete attribute. I have also used new-password but it still doesn't hide the list

Regards

Saad Saeed

1 Answers

When Blazor components map to a specific html element such as form or input you can usually include html elements.

For a single input you can add autocomplete="off"

<InputText autocomplete="off" ...other stuff.../>

Or you can disable it at form level like so

<EditForm autocomplete="off" ...other stuff...>

Related