4

I'm creating an Angular application with Devextreme components. The question is that I don't want that in my Login screen when I enter the username and password the browser suggests me to save the password: enter image description here

I would like to know if from my angular application there is a way to make this not happen and that this solution will work for some of the browsers. I would also like to know a solution to prevent the password fields from suggesting passwords as shown below:

enter image description here

At the moment I have tried adding the following parameters to my text components:

autocomplete="off"
autocomplete="new-password"
autocomplete="chrome-off"

The autocomplete="new-password" option works fine for me so that it does not autocomplete the fields when I have the password saved in the browser. But it still suggests me what I have shown in the two images above.

I hope someone can help. Thank you very much!

2

2 Answers 2

1

Currently, you can use autocomplete="one-time-code" to prevent password save prompts. It suggests autocompletion for single-use codes.

Refs:

Sign up to request clarification or add additional context in comments.

Comments

1

If you're using Devextreme components like DxTextBox, this will resolve the issue:

<dx-text-box ...
    [inputAttr]="{ autocomplete: 'new-password' }">
</dx-text-box>

if using in DxForm:

<dx-form ...>
    <dxi-item ... editorType="dxTextBox" [editorOptions]="{inputAttr: {autocomplete: 'new-password'}}"></dxi-item>
</dx-form>

NOTE: the Chrome team now requires that each input should have a valid autocomplete attribute value. That's why the "chrome-off" and "none" values stopped working.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.