1
0
mirror of synced 2025-02-03 21:59:24 +03:00

Fix dropdownAutoWidth so it actually works

Previously the `dropdownAutoWidth` option didn't work because the
dropdown was being absolutely positioned, so setting the width to
`auto` didn't actually have an effect. This cannot be solved by
just setting the width on the container, because that is also
absolutely positioned.

This closes https://github.com/select2/select2/issues/3101
This commit is contained in:
Kevin Brown 2016-03-27 15:24:37 -04:00
parent ac254ff68d
commit fe26b083eb

View File

@ -204,6 +204,7 @@ define([
if (this.options.get('dropdownAutoWidth')) {
css.minWidth = css.width;
css.position = 'relative';
css.width = 'auto';
}