We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 357678c commit 20beb5fCopy full SHA for 20beb5f
src/plugins/auto_position/plugin.js
@@ -21,8 +21,9 @@ Selectize.define("auto_position", function () {
21
controlPosBottom - dropdownHeight - wrapperHeight >= 0 ?
22
POSITION.top :
23
POSITION.bottom;
24
+ const w = this.$wrapper[0].style.width !== 'fit-content' ? '100%' : 'max-content';
25
const styles = {
- width: $control.outerWidth(),
26
+ width: w,
27
left: offset.left
28
};
29
@@ -43,6 +44,12 @@ Selectize.define("auto_position", function () {
43
44
}
45
46
this.$dropdown.css(styles);
47
+
48
+ if (w === 'max-content' && $control[0].getBoundingClientRect().width >= this.$dropdown[0].getBoundingClientRect().width) {
49
+ this.$dropdown.css({
50
+ width : '100%'
51
+ });
52
+ }
53
54
}());
55
});
0 commit comments