src/materialize/materialize.js
function(collection, newOption, firstActivation) {
        if (newOption) {
          collection.find('li.selected').removeClass('selected');
          var option = $(newOption);
          option.addClass('selected');
          if (!multiple || !!firstActivation) {
            options.scrollTo(option);
          }
        }
      }
function(collection, newOption, firstActivation) {
        if (newOption) {
          collection.find('li.selected').removeClass('selected');
          var option = $(newOption);
          option.addClass('selected');
          if (!multiple || !!firstActivation) {
            options.scrollTo(option);
          }
        }
      }
function ( collection , newOption , firstActivation ) { if ( newOption ) { collection . find ( 'li.selected' ) . removeClass ( 'selected' ) ; var option = $ ( newOption ) ; option . addClass ( 'selected' ) ; if ( ! multiple || ! ! firstActivation ) { options . scrollTo ( option ) ; } } }
Make option as selected and scroll to selected position
@param {jQuery} collection  Select options jQuery element
@param {Element} newOption  element of the new option
@param {Boolean} firstActivation  If on first activation of select
Make option as selected and scroll to selected position