javascript - Retain input focus in autocomplete on meteor js -


i've added https://github.com/mizzao/meteor-autocomplete meteor js project , can list of available options. i'm using arrow up- , down-keys mark entry , enter select it. cursor moves out of focus input field can't press enter again submit form. have click button on form perform submit.

html:

<div class="controls">   {{> inputautocomplete settings=settings id="name" name="name" placeholder="name" }} </div> 

i added focus js file helps before select item list:

template.raceaddparticipant.rendered = function () {   document.getelementbyid("name").focus(); }; 

how can circumvent this?

regards claus

(i wrote package.)

i'm guessing you're using autocomplete in single-field mode. implemented in feature prevent popup menu staying open after selection made. default, popup menu stays open whenever field focused (and there match), , enter button makes selection.

do have suggestion how behavior improved? if so, perhaps should open issue on github.


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -