| @@ -16,9 +16,11 @@ | ||
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | select2Arguments = wp.hooks.applyFilters( 'wppb_select2_initialize_arguments', select2Arguments, selectElement ); |
| 19 | 19 | |
| 20 | - if ( !( 'placeholder' in select2Arguments ) || select2Arguments.placeholder === '' ) { | |
| 20 | + // On a multiple select the placeholder lands in the inline search box, which is only as | |
| 21 | + // wide as the free space left by the selected options, so the field title gets truncated. | |
| 22 | + if ( !selectElement.prop( 'multiple' ) && ( !( 'placeholder' in select2Arguments ) || select2Arguments.placeholder === '' ) ) { | |
| 21 | 23 | select2Arguments.placeholder = jQuery('label[for="' + selectElement.attr('id') + '"]').text(); |
| 22 | 24 | } |
| 23 | 25 | |
| 24 | 26 | selectElement.select2( select2Arguments ).on('select2:open', function(){ |