title: select2 plugin works fine when not inside a jquery modal dialog
body: <p>I am using select2 plugin inside a jquery dialog but in does not work. When dropping down, the focus moves to the input control but immediately get out from it,not allowing me to type anything.</p>
  
  <p>This is the HTML:</p>
  
  <pre><code>&lt;div id="asignar_servicio" title="Asignar servicios a usuarios"&gt;
      &lt;input type="hidden" class="bigdrop" id="a_per_id" /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And this is the javascript code:</p>
  
  <pre><code>        $( "#asignar_servicio" ).dialog({
              autoOpen: false,
              height: 500,
              width: 450,
              modal: true,
              buttons: {
                  "Cancelar": function () {
                      $('#asignar_servicio').dialog('close');
                  }
              }
          });
          $("#a_per_id").select2({
              placeholder: "Busque un funcionario",
              width: 400,
              minimumInputLength: 4,
              ajax: {
                  url: "@Url.Action("Search", "Personal")",
                  dataType: 'json',
                  data: function (term, page) {
                      return {
                          q: term,
                          page_limit: 10,
                      };
                  },
                  results: function (data, page) {
                      return { results: data.results };
                  }
              }
          }).on("change", function (e) {
              var texto = $('lista_personal_text').val().replace(/ /g, '');
              if (texto != '')
                  texto += ',';
              texto += e.added.text;
  
              var ids = $('lista_personal_id').val().replace(/ /g, '');
              if (ids != '')
                  ids += ',';
              ids += e.added.id;
          });
  </code></pre>
  
  <p>I have this same code in other page and it works.</p>
  
  <p>Any help will be appreciated,</p>
  
  <p>thanks
  Jaime</p>