jquery - select2 force focus on page load -


i trying make select2 box appear in focused state on page load. have tried following:

$('#id').select2('focus'); $('#id').trigger('click'); $('#id').trigger('focus'); 

only first line seems have effect, , focus select2 field, requires additional keypress display search field, , allow typing in search string.

therefore, if load page , start typing: "search", "s" open search box , remainder of keys entered it, you'll searching "earch"

according select2 documentation:

$('#id').select2('open'); 

should need.

found under programmatic access section in documentation.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Socket.connect doesn't throw exception in Android -

iphone - How do I keep MDScrollView from truncating my row headers and making my cells look bad? -