简体   繁体   English

Angular 7 Material Design输入元素,自动补全问题

[英]Angular 7 Material Design input element, problems with autocompletion

in my Angular 7 I have a Material Design form with some input text fields; 在我的Angular 7中,我有一个包含一些输入文本字段的Material Design表单; I don't implemented any autocomplete command o function inside, as you can see from the code below. 正如下面的代码所示,我没有在其中实现任何自动完成命令o功能。 I also tried to delete all navigation data from my Chrome browser. 我还尝试从Chrome浏览器中删除所有导航数据。

(....)
<mat-form-field class="w-100">
        <input type="text" matInput formControlName="title">
</mat-form-field>
<mat-form-field class="w-100">
        <input type="text" matInput formControlName="name">
</mat-form-field>
(....)

But, I see autocomplete suggestions which takes text not only from the current field but also from the other one. 但是,我看到了自动完成建议,该建议不仅从当前字段获取文本,还从另一个字段获取文本。 In other words, I see my old "title" values which in the past I inserted as suggested values also in other fields. 换句话说,我看到了以前的“标题”值,过去我也将其作为建议值插入到其他字段中。

I am not sure it is related to Material Design itself; 我不确定它是否与Material Design本身有关; I searched other solutions but the "Material Autocompletion" which I found is not what I need beacause is a simple option combo box which takes value from a list (that is, as a drop down list). 我搜索了其他解决方案,但是发现“材料自动完成”并不是我所需要的,因为它是一个简单的选项组合框,该组合框从列表(即下拉列表)中获取值。 I also tried some HTML attributes but without success. 我也尝试了一些HTML属性,但没有成功。

I attach an image; 我附上图片; thank you very much! 非常感谢你!

在此处输入图片说明

This does not seem like a problem with Angular Material, no. 这似乎不是Angular Material的问题,不是。 This just seems as the browser trying to autocomplete inputs in a form for you. 这似乎是浏览器试图为您自动填写表单中的输入。
Try adding the following as the first attribute in your inputs: 尝试将以下内容添加为输入中的第一个属性:

 autocomplete="false"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM