Skip to content

Commit c4e8a82

Browse files
committed
chore: add auto dropdown width to demo
1 parent 747c013 commit c4e8a82

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

demo/src/options/options30.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,17 @@ <h2 class="bd-title">
8888
</select>
8989
</div>
9090
</div>
91+
92+
<div class="mb-3 row">
93+
<label class="col-sm-3 text-end"> Dropdown width </label>
94+
95+
<div class="col-sm-9">
96+
<select id="select4" data-width="200">
97+
<option value="1">This is the first option and value is 1</option>
98+
<option value="2">This is the second option and value is 2</option>
99+
<option value="3">This is the third option and value is 3</option>
100+
<option value="4">This is the fourth option and value is 4</option>
101+
</select>
102+
</div>
103+
</div>
91104
</div>

demo/src/options/options30.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export default class Example {
44
ms1?: MultipleSelectInstance;
55
ms2?: MultipleSelectInstance;
66
ms3?: MultipleSelectInstance;
7+
ms4?: MultipleSelectInstance;
78

89
mount() {
910
this.ms1 = multipleSelect('#select1', {
@@ -14,27 +15,29 @@ export default class Example {
1415
}) as MultipleSelectInstance;
1516

1617
this.ms2 = multipleSelect('#select2', {
17-
autoAdjustDropWidthByTextSize: true,
1818
autoAdjustDropHeight: true,
1919
position: 'top',
2020
showOkButton: true,
2121
}) as MultipleSelectInstance;
2222

2323
this.ms3 = multipleSelect('#select3', {
24-
autoAdjustDropWidthByTextSize: true,
2524
autoAdjustDropHeight: true,
2625
filter: true,
2726
position: 'top',
2827
}) as MultipleSelectInstance;
28+
29+
this.ms4 = multipleSelect('#select4') as MultipleSelectInstance;
2930
}
3031

3132
unmount() {
3233
// destroy ms instance(s) to avoid DOM leaks
3334
this.ms1?.destroy();
3435
this.ms2?.destroy();
3536
this.ms3?.destroy();
37+
this.ms4?.destroy();
3638
this.ms1 = undefined;
3739
this.ms2 = undefined;
3840
this.ms3 = undefined;
41+
this.ms4 = undefined;
3942
}
4043
}

0 commit comments

Comments
 (0)