选择下拉宽度,与输入无关 [英] Selectize dropdown width independent of input

查看:112
本文介绍了选择下拉宽度,与输入无关的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Selectize呈现非常长的标签的下拉列表.文本可以很宽,但是输入对宽度有限制. Selectize完美地包装了文本(在输入和下拉菜单中都包含在内),但理想情况下,下拉菜单将能够比输入更宽地缩放以提供更好的可读性.是否有可能使Selectize具有与输入无关的下拉宽度?

I am trying to use Selectize to render a dropdown of very long labels. The text can be pretty wide, but the input has a constraint on width. Selectize perfectly wraps the text (in both the input and drop downs) but ideally the drop down would be able to scale wider than the input to allow better readability. Is it possible to get Selectize to have a dropdown width independent of the input?

<select style="width:300px" multiple>
<option value="">Enter some tags...</option>
<option value="1" selected>QID7_4 : Where do you store your digital photos? Check all that apply.-On a cloud service like iCloud, Dropbox, Google Drive, or Amazon Cloud</option>
<option value="2">QID5_2 : What do you take pictures of most often? Please rank the following / by drag and drop.-Friends and social activities</option>
<option value="3">QID13_5 : How important is it to you that your photos are organized in the / following ways?-By quality (including favorites)</option>

当前外观:

所需外观:

想法是,如果下拉列表扩展为少换行,则文本更易读.

The idea is the text is much more readable if the dropdown expands to wrap less.

示例jsFiddle

推荐答案

每个标签的宽度都是通过JS动态设置的. 要覆盖如何执行以下操作:

The widths of each label are set dynamically through JS. To overwrite that how about doing something like this:

.selectize-dropdown {
    width: 600px !important;
}

小提琴

这篇关于选择下拉宽度,与输入无关的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆