Support

Account

Home Forums ACF PRO Select2 issue since 5.2.8 Reply To: Select2 issue since 5.2.8

  • Hi Elliot,

    Sure, here it is:

    This goes in the acf-input.js, around line 6500 (I have added console logs hence the approx.):

    			// re-order options
    			$.each( selection, function( k, value ){
    				
    				$.each( select2_args.data, function( i, choice ){
    
    					if ( typeof choice.children !== 'undefined' && choice.children.length ) {
    						$.each( choice.children, function( j, choice ) {
    							if ( value == choice.id )
    								initial_selection.push( choice );
    						});
    					}
    					else
    					{
    						if( value == choice.id ) {
    						
    							initial_selection.push( choice );
    
    							
    						}
    					}
    					
    				});
    							
    			});
    

    Thanks so much!