Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add autoSelect top-level option #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nmaquet
Copy link

@nmaquet nmaquet commented Jan 1, 2015

Adds a new autoSelect boolean option (default is true) that controls whether the first search result should be automatically selected or not. Setting it to false is useful when using token-less autocompletion for a search input (user can enter an arbitrary string and ignore the autocomplete).

@mizzao
Copy link
Collaborator

mizzao commented Feb 27, 2015

Are you saying that the user pressing Tab or Enter will select an unwanted result by accident? Is it getting in the way of principle of least surprise?

@nmaquet
Copy link
Author

nmaquet commented Mar 5, 2015

This is really only useful when using token-less autocomplete in a field where only a predefined set of values are allowed. For instance, you can add autocomplete on a "city" field with hundreds of possible values. Setting autoselect to true in that case guarantees that the user always selects a valid option. This is akin to how a dropdown works.

@todda00
Copy link

todda00 commented Jun 17, 2015

I am looking for this exact setting as well, I will test this pull to make sure it works for my use case, which is to provide search string suggestions, but not force the user to select one of the options. Currently typing in whatever you want to search for and clicking enter will select the first option.

@todda00
Copy link

todda00 commented Jun 17, 2015

This works perfectly for my situation. I merged this locally with the master branch and it worked as expected.

@leizard
Copy link

leizard commented Apr 19, 2016

+1. I think this should be merge to the master branch. I have the exact context and want to disable auto select top option

@c0811g0911
Copy link

+1 agree with this change

@mizzao
Copy link
Collaborator

mizzao commented Jun 29, 2016

Hey @nmaquet, I apologize for the delay in responding.

I don't have time to maintain this project anymore, so I gave you commit access to make any changes you'd like. It would be nice to follow the style used by the rest of the code and add some tests to this patch.

If you'd like permission to publish the package to Meteor as well, please send me your Meteor username.

@nmaquet
Copy link
Author

nmaquet commented Jun 29, 2016

Thanks, @mizzao!
I'm not actually using Meteor that much currently but I'll do my best in maintaining the repo and / or finding someone who'd be willing to maintain it. My meteor account is https://atmospherejs.com/tinsik

@mizzao
Copy link
Collaborator

mizzao commented Jun 30, 2016

Great, you are now a maintainer: https://atmospherejs.com/mizzao/autocomplete .

No pressure to do anything, it's just if you are interested and willing.

@rkgomekar
Copy link

I tried autoSelect :false and autoSelect : "false"
Didn't work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants