dist/js/materializecss-autocomplete.js
function updateScroll() {
      if (!self.element.li[0]) return;
      var height = self.element.li[0].offsetHeight,
        top = height * self.index,
        bot = top + height,
        hgt = self.element.scroller.clientHeight,
        scrollTop = self.element.scroller.scrollTop;
      if (top<scrollTop) {
        scrollTo(top);
      }else if (bot>scrollTop + hgt) {
        scrollTo(bot - hgt);
      }
    }
function updateScroll() {
      if (!self.element.li[0]) return;
      var height = self.element.li[0].offsetHeight,
        top = height * self.index,
        bot = top + height,
        hgt = self.element.scroller.clientHeight,
        scrollTop = self.element.scroller.scrollTop;
      if (top<scrollTop) {
        scrollTo(top);
      }else if (bot>scrollTop + hgt) {
        scrollTo(bot - hgt);
      }
    }
function updateScroll ( ) { if ( ! self . element . li [ 0 ] ) return ; var height = self . element . li [ 0 ] . offsetHeight , top = height * self . index , bot = top + height , hgt = self . element . scroller . clientHeight , scrollTop = self . element . scroller . scrollTop ; if ( top < scrollTop ) { scrollTo ( top ) ; } else if ( bot > scrollTop + hgt ) { scrollTo ( bot - hgt ) ; } }
Makes sure that the focused element is within view.
Makes sure that the focused element is within view .