Asp.net mvc Select2搜索框值张贴在表单提交上,即使值不匹配

Asp.net mvc Select2搜索框值张贴在表单提交上,即使值不匹配,asp.net-mvc,jquery-select2,Asp.net Mvc,Jquery Select2,问题: 在select2搜索框中搜索后按enter键时,文本框将填充搜索值(并在表单提交中发布),即使搜索值不匹配。 在搜索过程中: 按Enter键后: 我在razor视图中使用select2(select2.full.jsversionselect2 4.0.6-rc.1) HTML: Javascript: $(document).find('.select2picker').select2({ tags: true, }); 不匹配是什么意思?您键入的内容也有duo的

问题:

在select2搜索框中搜索后按enter键时,文本框将填充搜索值(并在表单提交中发布),即使搜索值不匹配。

在搜索过程中:

按Enter键后:

我在razor视图中使用select2(
select2.full.js
version
select2 4.0.6-rc.1

HTML:

Javascript:

$(document).find('.select2picker').select2({
        tags: true,
});

不匹配是什么意思?您键入的内容也有duo的结果。这意味着下拉列表不包含“duo”。请从Javascript中删除
标记:true
$(document).find('.select2picker').select2({
        tags: true,
});