Open nmaquet opened 9 years ago
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?
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.
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.
This works perfectly for my situation. I merged this locally with the master branch and it worked as expected.
+1. I think this should be merge to the master branch. I have the exact context and want to disable auto select top option
+1 agree with this change
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.
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
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.
I tried autoSelect :false and autoSelect : "false" Didn't work
Adds a new
autoSelect
boolean option (default istrue
) that controls whether the first search result should be automatically selected or not. Setting it tofalse
is useful when using token-less autocompletion for a search input (user can enter an arbitrary string and ignore the autocomplete).