0

Since the my Select2 dropdown list default behavior would adjust width according to selection and mess up my frame, I'd like it not to wrap the text. I've tried several combinations with no result (see below)

var $select1 = $('<select/>', {
    //'class': "form-control",
    'class': displaySearchClass,
    'id': cbxID1,
    //'width': largeurMenu,
    'multiple': 'multiple',
    //'white-space': 'normal!important',
    //'dropdownAutoWidth' : 'true',
    //'overflow': 'hidden',
    //'text-overflow': 'ellipsis',
    //'white-space': 'nowrap !important',
});

below is a screenshot of my problem and another of what I want it to be looking like Default behavior

What I want to achieve

Patrice
  • 115
  • 1
  • 1
  • 14

1 Answers1

0

try this:

$("#myselect").select2({ width: '100%' });

From

Edward Young
  • 2,360
  • 1
  • 10
  • 8