Usability Issues
Thanks for a wonderful library. I ran into a minor annoyance and a few others colleagues seem to share the same sentiment.
Looking at the first example, if you type united the top suggestion is United Arab Emirates. Hitting TAB to auto-complete results in united Arab Emirates (notice the lower case united). This implies that the first option was selected but this is in fact not true but that's a guess.
I ascertained it wasn't selected because the drop-down was still available and showing United Arab Emirates as an option which means it did not get selected. Once I click away and clicking back on the input field, the drop down displays again so at this point I was certain it wasn't selected. Ideally, hitting TAB should just auto complete and select United Arab Emirates (with correct casing to confirm it was indeed selected).
At this point I saw united Arab Emirates (with lower case) and hit enter, but nothing happened. It might be though because the example page is not wired to submit.
In any case, when I do press down-arrow and hit enter to select United Arab Emirates, I expect the option was selected and mission accomplished. But then I hit TAB again (this time to focus out of the box) and the box reverted back to united Arab Emirates (lower case) even after I selected the option.
Hope I am not misunderstanding the use of this library.
See #49 for a brief discussion on the behavior for tab. I'm on the fence when it comes to what I think the correct behavior should be.
The last part of your comment is actually a bug, I'll make sure it gets fixed for the next release.
I'm on the fence
Fair enough, both behaviors are valid, the current especially for search and is the same used by Google.
Would you be open to providing an option so user's can set it according to their own use-case?
I only ask because twitter/typeahead is far superior to harvestq/chosen and ivaynberg/select2 which are currently very popular for tagging use-case but neither offer partial-fetching or caching, both of which are essential for tagging. Tagging typically requires TAB completion for efficiency and "exact matching". For that matter, any enumerable selection (tagging, locations, names) would benefit from "exact matching" on TAB completion.
If I am understanding correctly, I would second this. Autocomplete is, by definition, automatically completing a string based on another known string. Converting "united" to "united Arab Emirates" when there is no such string in the dataset doesn't make a whole lot of sense to me.
The interesting/tricky issue is that in various other tab-activated autocomplete methods, the query is case-sensitive (e.g. cmd prompt). While case-sensitive autocomplete would be an awful user experience, modifying the case of the query isn't so bad, especially if the only match(es) use different capitalization.
Im not sure how this behaves with non-english languages, but I imagine searching for "uber" and pressing tab could/should automatically convert the query to "über" if that was the only match. This would be consistent with the aforementioned feature change/request. This latter example would, I imagine, require a little localization fun, so perhaps that would be something to implement down the road. The driving concept is the same,however.
Best, Devon
Sent from my iPhone
On Mar 12, 2013, at 3:55 AM, aleemb [email protected] wrote:
I'm on the fence
Fair enough, both behaviors are valid, the current especially for search and is the same used by Google.
Would you be open to providing an option so user's can set it according to their own use-case?
I only ask because twitter/typeahead is far superior to harvestq/chosen and ivaynberg/select2 which are currently very popular for tagging use-case but neither offer partial-fetching or caching, both of which are essential for tagging. Tagging typically requires TAB completion for efficiency and "exact matching". For that matter, any enumerable selection (tagging, locations, names) would benefit from "exact matching" on TAB completion.
— Reply to this email directly or view it on GitHubhttps://github.com/twitter/typeahead.js/issues/107#issuecomment-14762691 .
I'm starting to come around on the autocomplete issue. I'll look into either changing behavior or making the behavior configurable for a future release. If you'd like to discuss the autocomplete issue some more, let's move the discussion to #49.