我正在使用angular-datatables,Chrome浏览器会使用电子邮件ID自动填充表格搜索。
我尝试用空字符串覆盖搜索,但仍然使用Chrome自动填充电子邮件ID
dtTrigger: Subject<any> = new Subject();
dtOptions: DataTables.Settings = {};
this.dtOptions = {
pagingType: 'full_numbers',
pageLength: 10,
"dom": '<"top"f>rt<"bottom"lip><"clear">',
responsive: true,
search :{
search : " "
}
};
所以这里search:“ anything”它会搜索表中的所有内容,我尝试使用空ID的空字符串chrome自动填充电子邮件ID。
如何强制Chrome不在搜索输入中填充电子邮件。
我在Github存储库中查看其运行方式。
我在本文档中发现了对jquery库的依赖:
http://l-lin.github.io/angular-datatables/#/getting-started
npm install datatables.net --save
稍后我在jquery库内部搜索了输入字段。
/ node_modules / datatables.net / js / jquery.dataTables.js
在line 4182中,我刚刚添加了一个属性autocomplete =“ off”
var input = '<input type="search" autocomplete="off" class="'+classes.sFilterInput+'"/>';
是的,这有点棘手,如果有效,请告诉我在datatables github存储库中发出拉取请求。