up/down arrow key issue with typeahead control (angular bootstrap UI)

前端 未结 4 999
自闭症患者
自闭症患者 2020-11-30 09:05

Check this PLNKR , i have implemented typeahead control, By default in type ahead control they are not setting any max-height or height to list, but as per

4条回答
  •  無奈伤痛
    2020-11-30 10:00

    @user1690588 answer works great. Only problem is that when the last item in the list is active and you press the down key. the scrollToView tothe first item does not work. I added a check to ensure newVal is true which seems to fix this.

      if (newVal) { 
        element[0].scrollIntoView(false);
      }
    

    http://plnkr.co/edit/05yoHSlhvX740tgiRRXm

提交回复
热议问题