How to implement a live search in Meteor without text input blurring after every letter?

前端 未结 1 1799
终归单人心
终归单人心 2021-01-01 05:35

I am trying to implement a basic live search bar so I have an event listening to any keyup:

\'keyup input.search-query\': function (evt) {
    Session.set(\"         


        
相关标签:
1条回答
  • 2021-01-01 06:04

    The problem was in the HTML actually.

    I has the search bar and the search results in the same template, so whenever the template would refresh with new results, it would blur the search bar. All I did was make the search results its own template and import that template below the search bar so everything looks the same.

    0 讨论(0)
提交回复
热议问题