我正在尝试使用Selectize来渲染非常长标签的下拉列表。文本可以很宽,但输入对宽度有约束。 Selectize完美地包装文本(在输入和下拉中),但理想情况下,下拉可以比输入更宽,以提供更好的可读性。是否有可能使Selectize具有与输入无关的下拉宽度?
<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>
目前看:
这个想法是,如果下拉列表扩展为包装更少,则文本更具可读性。
答案 0 :(得分:15)
答案 1 :(得分:5)
当下拉菜单应将其宽度动态更改为最大选项时:
.selectize-dropdown {
width: auto !important;
}
.selectize-dropdown [data-selectable], .selectize-dropdown .optgroup-header {
white-space: nowrap;
}
答案 2 :(得分:3)
罗宾的答案对我不起作用。但是以下情况确实如此。
.selectize-input {
min-width: 600px !important;
}
答案 3 :(得分:0)
.selectize-control {
width: 90% !important;
}
这将使您具有响应能力。