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
Post a Comment