Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit 30adfa3

Browse files
committed
Fix Selectize input width
1 parent 4471ab3 commit 30adfa3

File tree

5 files changed

+38
-22
lines changed

5 files changed

+38
-22
lines changed

dist/select.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/* Style when highlighting a search. */
12
.ui-select-highlight {
23
font-weight: bold;
34
}
5+
6+
/* Fix input width for Selectize theme */
7+
.selectize-control > .selectize-input > input {
8+
width: 100%;
9+
}
10+
11+
/* Fix dropdown width for Selectize theme */
12+
.selectize-control > .selectize-dropdown {
13+
width: 100%;
14+
}

examples/demo.html

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@
4444
color: #333;
4545
}
4646

47-
.selectize-dropdown {
48-
width: 100%;
47+
.selectize-control > .selectize-dropdown {
4948
top: 36px;
5049
}
5150
</style>
@@ -58,19 +57,19 @@
5857

5958
<p>Select2 theme (default):</p>
6059
<ui-select ng-model="person.selected" style="width: 300px;">
61-
<match placeholder="Pick one...">{{$select.selected.name}}</match>
60+
<match placeholder="Select or search a person in the list...">{{$select.selected.name}}</match>
6261
<choices data="people | filter: $select.search">
6362
<div ng-bind-html="trustAsHtml((item.name | highlight: $select.search))"></div>
64-
<div>{{item.email}}</div>
63+
<small ng-bind-html="trustAsHtml((item.email | highlight: $select.search))"></small>
6564
</choices>
6665
</ui-select>
6766

6867
<p>Selectize theme:</p>
6968
<ui-select ng-model="person.selected" theme="selectize" style="width: 300px;">
70-
<match placeholder="Pick one...">{{$select.selected.name}}</match>
69+
<match placeholder="Select or search a person in the list...">{{$select.selected.name}}</match>
7170
<choices data="people | filter: $select.search">
7271
<div ng-bind-html="trustAsHtml((item.name | highlight: $select.search))"></div>
73-
<div>{{item.email}}</div>
72+
<small ng-bind-html="trustAsHtml((item.email | highlight: $select.search))"></small>
7473
</choices>
7574
</ui-select>
7675
</body>

examples/select2-bootstrap3.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828

2929
<!--
3030
Select2 theme
31-
Bootstrap 3 theme from http://fk.github.io/select2-bootstrap-css/
32-
GitHub project: https://github.com/fk/select2-bootstrap-css
31+
Bootstrap 3 theme from https://github.com/fk/select2-bootstrap-css
3332
-->
3433
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/select2/3.4.5/select2.css">
3534
<link rel="stylesheet" href="http://fk.github.io/select2-bootstrap-css/css/select2-bootstrap.css">
@@ -55,7 +54,7 @@
5554
<div class="col-sm-6">
5655

5756
<ui-select ng-model="person.selected" theme="select2" class="form-control">
58-
<match placeholder="Pick one...">{{$select.selected.name}}</match>
57+
<match placeholder="Select or search a person in the list...">{{$select.selected.name}}</match>
5958
<choices data="people | filter: $select.search">
6059
<div ng-bind-html="trustAsHtml((item.name | highlight: $select.search))"></div>
6160
<small ng-bind-html="trustAsHtml((item.email | highlight: $select.search))"></small>
@@ -71,7 +70,7 @@
7170
<div class="input-group select2-bootstrap-append">
7271

7372
<ui-select ng-model="person.selected" theme="select2" class="form-control">
74-
<match placeholder="Pick one...">{{$select.selected.name}}</match>
73+
<match placeholder="Select or search a person in the list...">{{$select.selected.name}}</match>
7574
<choices data="people | filter: $select.search">
7675
<span ng-bind-html="trustAsHtml((item.name | highlight: $select.search))"></span>
7776
<small ng-bind-html="trustAsHtml((item.email | highlight: $select.search))"></small>

examples/selectize-bootstrap3.html

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,16 @@
3737
padding: 15px;
3838
}
3939

40-
.selectize-dropdown {
41-
width: 100%;
42-
top: 34px;
43-
}
44-
4540
.selectize-control {
46-
/* Selectize is positionned too high */
41+
/* Align Selectize with input-group-btn */
4742
top: 2px;
4843
}
4944

50-
/**
51-
* Reset right rounded corners
52-
* See Bootstrap input-groups.less
53-
*/
45+
.selectize-control > .selectize-dropdown {
46+
top: 34px;
47+
}
48+
49+
/* Reset right rounded corners, see Bootstrap input-groups.less */
5450
.input-group > .selectize-control > .selectize-input {
5551
border-bottom-right-radius: 0;
5652
border-top-right-radius: 0;
@@ -73,7 +69,7 @@
7369
<div class="col-sm-6">
7470

7571
<ui-select ng-model="person.selected" theme="selectize">
76-
<match placeholder="Pick one...">{{$select.selected.name}}</match>
72+
<match placeholder="Select or search a person in the list...">{{$select.selected.name}}</match>
7773
<choices data="people | filter: $select.search">
7874
<div ng-bind-html="trustAsHtml((item.name | highlight: $select.search))"></div>
7975
<small ng-bind-html="trustAsHtml((item.email | highlight: $select.search))"></small>
@@ -89,7 +85,7 @@
8985
<div class="input-group">
9086

9187
<ui-select ng-model="person.selected" theme="selectize">
92-
<match placeholder="Pick one...">{{$select.selected.name}}</match>
88+
<match placeholder="Select or search a person in the list...">{{$select.selected.name}}</match>
9389
<choices data="people | filter: $select.search">
9490
<span ng-bind-html="trustAsHtml((item.name | highlight: $select.search))"></span>
9591
<small ng-bind-html="trustAsHtml((item.email | highlight: $select.search))"></small>

src/select.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/* Style when highlighting a search. */
12
.ui-select-highlight {
23
font-weight: bold;
34
}
5+
6+
/* Fix input width for Selectize theme */
7+
.selectize-control > .selectize-input > input {
8+
width: 100%;
9+
}
10+
11+
/* Fix dropdown width for Selectize theme */
12+
.selectize-control > .selectize-dropdown {
13+
width: 100%;
14+
}

0 commit comments

Comments
 (0)