Chosen: 在引导程序 3.x 对话框中选择的样式不正确。

创建于 2017-05-31  ·  6评论  ·  资料来源: harvesthq/chosen

在这里总结您的问题。
在引导程序 3.x 对话框中选择的样式不正确。

重现步骤

加载引导程序的 css
加载加载一个对话框。
打开对话框

此外,请链接到显示问题的工作演示,以便我们尝试重现。 您可以将此模板用作基础。 或者,确认选择的演示页面显示了问题。

预期行为

显示样式精美且可搜索的下拉菜单

实际行为

干得好
image

环境

  • 选择版本
    selected_v1.6.2/

  • jQuery 或原型版本
    /jquery/1.11.2/jquery.min.js'

  • 浏览器和版本
    Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0

  • 操作系统和版本
    窗口 10

附加信息

不适用

最有用的评论

好的,只是为此添加更新。
当我在初始化方法中传递宽度时,所有工作都没有上面的 hack。

$("select").chosen({
                search_contains : true, // kwd can be anywhere
                max_selected_options: 1,
                max_shown_results : 5, // show only 5 suggestions at a time
                width: "95%",
                no_results_text: "Oops, nothing found!"
            } );

所有6条评论

选择的 1.6.2 不是最新版本 - 您对最新发布的版本还有问题吗?

我会确保我拥有它并让你知道。

是的,即使在最新的 1.7 版本中问题仍然存在。

我检查了一些 stackoverflow 主题并提出了此修复程序。

$('.modal').filter('[class*=_dialog]').on('show.bs.modal', function () {
                // This makes the dialog expand when shown in a bootstrap dlg
                $(this).find('.chosen-container').css({width: "100%"});
            });

该应用程序是针对客户的自定义应用程序,无法提供指向它的链接。

好的,只是为此添加更新。
当我在初始化方法中传递宽度时,所有工作都没有上面的 hack。

$("select").chosen({
                search_contains : true, // kwd can be anywhere
                max_selected_options: 1,
                max_shown_results : 5, // show only 5 suggestions at a time
                width: "95%",
                no_results_text: "Oops, nothing found!"
            } );

感谢您的黑客@lordspace。 我花了很长时间才找到您的修复方法。

我不确定为什么这个问题在“bootstrap-chosen”repo (https://github.com/alxlit/bootstrap-chosen/issues/54) 中被关闭。

不用担心。 也许我关闭了它,假设它不是一个错误,如果它可以通过选项修复,但是当我现在考虑它时,它应该是开箱即用的。

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

vpode picture vpode  ·  5评论

jbrooksuk picture jbrooksuk  ·  6评论

raggzy picture raggzy  ·  5评论

asvetlenko picture asvetlenko  ·  3评论

engintekin picture engintekin  ·  8评论