Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular Materials: Can you disable the autocomplete suggestions for an input?

I'm just using simple input containers such as this

<md-input-container class="md-block" flex-gt-sm >     <label>Name</label>     <input md-maxlength="30" name="name" ng-model="name" /> </md-input-container> 

The input field is suggesting previously entered values which is obscuring some important interface elements and also really not necessary in my case. Is there any way to disable the suggestions?

like image 705
Bryce Rogers Avatar asked Feb 17 '16 04:02

Bryce Rogers


People also ask

How do I disable input field autocomplete?

Add autocomplete="off" onto <form> element; Add hidden <input> with autocomplete="false" as a first children element of the form.

How do I disable autocomplete material?

Disabling the autocomplete To disable the autocomplete for input fields, we need to set its autocomplete attribute to off . We can also disable the autocomplete for an entire form, instead of a specific input field by setting an autocomplete="off" to the html <form> element.

How do you disable the suggestions in the text field which attribute is used?

Use the <input> tag with autocomplete attribute. Set the autocomplete attribute to value “off”.

How do I use angular material autocomplete?

Start by creating the autocomplete panel and the options displayed inside it. Each option should be defined by a mat-option tag. Set each option's value property to whatever you'd like the value of the text input to be when that option is selected.


1 Answers

Add autocomplete="off" to the input element, just like this:

<input md-maxlength="30" name="name" ng-model="name" autocomplete="off" /> 

See this for your reference.

like image 89
Bharat Gupta Avatar answered Oct 05 '22 22:10

Bharat Gupta