Skip to content

Commit ece3c23

Browse files
authored
Merge pull request #1814 from vanboom/feature-minwidth
Issue #1653 implement a minwidth setting to improve responsive situations
2 parents f85a6e9 + 221dbaf commit ece3c23

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/selectize.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1936,9 +1936,13 @@ $.extend(Selectize.prototype, {
19361936
var $control = this.$control;
19371937
var offset = this.settings.dropdownParent === 'body' ? $control.offset() : $control.position();
19381938
offset.top += $control.outerHeight(true);
1939-
1939+
var w = $control[0].getBoundingClientRect().width;
1940+
if (this.settings.minWidth && this.settings.minWidth > w)
1941+
{
1942+
w = this.settings.minWidth;
1943+
}
19401944
this.$dropdown.css({
1941-
width : $control[0].getBoundingClientRect().width,
1945+
width : w,
19421946
top : offset.top,
19431947
left : offset.left
19441948
});

0 commit comments

Comments
 (0)