mtkopone / zelect

From <select> to something more 2012
Do What The F*ck You Want To Public License
395 stars 42 forks source link

Is there a way to add autofocus? #14

Open firedev opened 11 years ago

firedev commented 11 years ago

I need it to replace an old select-to-autocomplete script which is used to choose employee name. And I need it to auto-focused on page load.

Right now I have solved it like this:

$('.zelect .placeholder').click();

But this is obviously not a good way to do things. It would be best if it could parse autofocus attribute from the original <select> tag.

Thanks!

mtkopone commented 11 years ago

I'll look into this next time I get a chance.

To clarify, you would like the zelect to be initially rendered in the "open" state, showing the search input and the list of options?

firedev commented 11 years ago

I think just a focus on the field so user could start typing in right away is enough.