LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code
CSS
html {
  font-size: 14px;
  font-family: Arial, sans-serif;
}

body {
  min-height: 100rem;
  margin: 0;
  padding: 1rem;
}

select {
  width: 20rem;
  max-width: 100%;
}
JS
// apply this event to all select2 elements
$(document).ready(function() {
  $('.js-is-select2').on('select2:open', function() {
    if (Modernizr.touch) {
      $('.select2-search__field').prop('focus', false);
    }
  });
});

$(document).ready(function() {
  $('.js-source-states').select2();
});

Description

The select2 plugin's default behavior is to automatically focus the search-input when the select2-dropdown is opened.
Term
Sat, 04/14/2018 - 20:43

Related Codes

Pen ID
Pen ID
Pen ID
Square Adv