title: Select2 with AJAX: select disappears after recieving AJAX results
body: <p>I have reviewed many questions and answers here, but the problem still persists. This is my select (one of them):</p>
  <pre><code>&lt;div class=&quot;col-md-2&quot;&gt;
      &lt;label for=&quot;wh_location&quot;&gt;{{ __('reports.warehouse_movement.location') }}&lt;/label&gt;
      &lt;div class=&quot;input-group&quot;&gt;
          &lt;select name=&quot;wh_location&quot; id=&quot;wh_location&quot; class=&quot;form-control select2&quot; multiple&gt;&lt;/select&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <p>And then it goes:</p>
  <pre><code>$(document).ready(() =&gt; {
    $('.select2').select2(); // For Non-AJAX select2 boxes;
  
    $('#wh_location').select2({
    minimumInputLength: 3, // Commenting this out will show all results at once, but if you try to search, all results disapper;
    delay: 500,
    allowClear: true,
    minimumResultsForSearch: -1,
    ajax: {
      url: '{{ route('rpc.report', ['WarehouseMovement', 'getLocationsList']) }}',
      dataType: 'json',
      method: 'post',
      delay: 500,
    }
  });
  </code></pre>
  <p>The problem is that after searching for a value, it shows &quot;Searching&quot; and then the select dropdown disappears completely. Inspecting it in element, it shows an empty UL tag:</p>
  <p><a href="https://i.stack.imgur.com/Q4y2k.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Q4y2k.png" alt="Here it is" /></a></p>
  <p>My backend (PHP) is returning correct JSON format, so no need for <code>processResults</code> callback function in the AJAX (although I tried this as well):</p>
  <pre><code>{&quot;results&quot;:{&quot;35&quot;:{&quot;id&quot;:&quot;750&quot;,&quot;text&quot;:&quot;750 Test1&quot;},&quot;137&quot;:{&quot;id&quot;:&quot;750&quot;,&quot;text&quot;:&quot;750 Test OLD&quot;},&quot;166&quot;:{&quot;id&quot;:&quot;750&quot;,&quot;text&quot;:&quot;750 Test New&quot;}}}
  </code></pre>
  <p>I've already checked everything, so:</p>
  <ol>
  <li>The ID value is unique;</li>
  <li>All other select2 boxes work without any problem with the SAME EXACT code;</li>
  <li><code>processResults</code> callback and returning an array from PHP does nothing;</li>
  <li>PHP returns the same exact format as for all other select2 boxes;</li>
  <li>Select2 is being rendered and worked fine without AJAX;</li>
  <li>Maybe there's some kind of limit of select2 boxes? I tried disabling all of them, except this one - nothing changed;</li>
  <li>The select2 is being loaded from here: <code>&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.5/js/select2.full.js&quot;&gt;&lt;/script&gt;</code></li>
  </ol>
  <p>What am I missing here? I've ran into the same problem couple of days ago, but then I decided just to ditch that field.</p>