【发布时间】:2018-09-12 14:17:28
【问题描述】:
JSFiddle:http://jsfiddle.net/xpvt214o/776660/
When the choice box is open, if you try clicking anywhere outside on the level of the choice box, it doesn't get closed.但是,如果您在当前选择线的级别上单击外部,则它确实会关闭。
当执行任何外部单击(包括在选择框级别)时,如何强制关闭 Select2 选择框?
附:我使用closeOnSelect: false 选项在选择过程中保持选择框始终打开——但它仍应在外部点击时关闭,
$('#dropdown').select2({
closeOnSelect: false
});
另一个类似的问题 - closing select2 on click away when closeonselect is false
【问题讨论】:
标签: jquery jquery-select2