양식의 드롭 다운에 select2를 사용하고 있으며 테이블 레이아웃을 사용하고 있습니다. (문제의 일부일지도 모릅니다.) 모든 양식의 너비를 유지하려면 - 그룹 요소는 동일합니다.select2 dropwdown을 일정한 길이로 유지하는 방법
문제는 select2 드롭 다운에 텍스트를 입력 할 때 폭이 변경된다는 것입니다 (이상한 방법으로). 브라우저가 select2 드롭 다운을 고정 된 채로 유지하도록 초기 너비를 강제 할 수있는 방법이 있습니까?
<table>
<tr>
<td>
<div class="row">
<div class="form-group">
<label>Title</label>
<input name="title" class="form-control"/>
</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="row">
<div class="form-group">
<label>a label</label>
<input class="form-control"/>
</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="row">
<div class="form-group">
<label>a label</label>
<select id="tag_list" class='form-control' multiple="multiple">
<option value='1'>abba</option>
<option value='2'>zabba</option>
<option value='3'>doo</option>
</select>
</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="row">
<div class="form-group">
<label for="category_type">Category Type:</label>
<select name="category_type" id="category_type_list" class="form-control">
<option value="" disabled selected>If there is a matching type for the category, please select it</option>
<option value="1">A</option>
<option value="2">B</option>
</select>
</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="row action">
<div class="form-group">
<div class="inline">
<button class="btn btn-primary form-control" type="submit">submit</button>
</div>
<div class="inline">
<button class="btn btn-primary cancel">Cancel</button>
</div>
</div>
</div>
</td>
</tr>
</table>
내 CSS :
.form-group{
display: block;
}
table {
margin-left: 5%;
table-layout: fixed;
}
input {
height: 30px;
border: 1px solid #e3e3e3;
padding: 3px 10px;
width: 100%;
}
.inline{
float:left;
margin-right: 5px;
}
span.select2-container{
width: 100% !important;
tex-overflow: ellipsis;
}
Here는 바이올린 예입니다
여기 내 HTML입니다. select2 드롭 다운에 충분히 오래 입력하고 Enter 키를 누르면 너비가 변경됩니다. 어떻게 그 일을 막을 수 있습니까?
이렇게 고정 되셨습니까? 나는 몇 가지 아이디어를 가지고 있지만 당신의 바이올린과 함께 진짜 문제는 보지 못합니다. – Bindrid
아니요, 고정되지 않았습니다. 바이올린에서 "짧은 설명 ..."의 자리 표시자를 가진 세 번째 입력에서 긴 단어 (몇 마디)를 입력 한 다음 Enter 키를 누릅니다. Enter 키를 누르면 너비가 변경됩니다. 나는 그 일을 멈추고 싶다. – user3494047