我遇到了一个问题,select2下拉菜单在打开时仍然保持焦点。
基本上,当您使用select2单击下拉菜单时,会显示一个特殊的select2下拉菜单,顶部有一个文本输入,这样您就可以开始键入并缩小选择选项的范围。当select2下拉菜单打开时,焦点不在搜索输入中。它仍然在原始的select html元素上。
这是一个在CodePen上工作的select2下拉菜单,只是作为一个例子。我不能复制我在CodePen中遇到的问题,所以它让我觉得在我的网站上有一些冲突。但我不知道是什么,我似乎也不能缩小范围。
see codepen for sample working code
我可以看到焦点在打开
我正在尝试使用select 2在html/js中创建一个可搜索的下拉菜单: <!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<link href="
在MultiSelect中,选择下拉菜单项从菜单中删除并显示在选定列表中时 https://codesandbox.io/s/8qw3p?module=/example.js&file=/example.js 我们是否可以保留下拉菜单中的选定项并显示选定项。 我们可以保持海洋在下拉菜单中,即使它是选中的。 current result