Skip to content
This repository has been archived by the owner on Nov 22, 2021. It is now read-only.

feature: add option to automatically 'select' the option, if it is the only option. #136

Closed
funkjunky opened this issue Apr 26, 2014 · 4 comments

Comments

@funkjunky
Copy link

In google auto completes you can hit tab to complete until a disambiguate.
This is maybe tricky... or not... but at the very least it would be nice to complete if there is only one option matching the query.

Through my silly foray into reinventing your plugin for no reason, because I found imaginary issues, I added this feature, so I could re-add it, if it seems reasonable.

So if the concept of the feature is acceptable, I'll write a test to cover it, then make a pull request.

@mbenford
Copy link
Owner

I didn't get the "complete if there is only one option matching the query" part. Would you mind explaining it better?

@funkjunky
Copy link
Author

The promise that you pass to get the list of item, given a query. If the returned array has a length of 1, then automatically select that entry.

So if I search "bana" and the function returns ["banana"], which has a length of 1, then automatically select(1), so the user can hit tab and continue adding tags without having to either hit down (far from home row), click, or finish typing the entire word.

@mbenford
Copy link
Owner

I get it now. Perhaps there could be an option to make the directive always select the first suggestion, regardless of how many items have returned? What do you think?

@funkjunky
Copy link
Author

That would also hint to the user that they could use the up and down key to
select different options.

On Wed, Apr 30, 2014 at 12:44 AM, Michael Benford
[email protected]:

I get it now. Perhaps there could be an option to make the directive
always select the first suggestion, regardless of how many items have
returned? What do you think?


Reply to this email directly or view it on GitHubhttps://github.com//issues/136#issuecomment-41760324
.

@mbenford mbenford added this to the Backlog milestone Apr 30, 2014
hamchapman added a commit to hamchapman/ngTagsInput that referenced this issue Jul 10, 2014
Add an option to make the first tag suggestion be
automatically selected as soon as it appears. The
default value is false.

Closes mbenford#136
@mbenford mbenford modified the milestones: 2.2.0, Backlog Mar 2, 2015
Bessonov pushed a commit to Bessonov/ngTagsInput.ie8 that referenced this issue May 3, 2015
Add an option to make the first tag suggestion be automatically selected
as soon as it appears. The default value is false.

Closes mbenford#136
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants