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

global config for min_length #39

Open
tinyfive opened this issue Jan 6, 2016 · 4 comments
Open

global config for min_length #39

tinyfive opened this issue Jan 6, 2016 · 4 comments

Comments

@tinyfive
Copy link

tinyfive commented Jan 6, 2016

Thanks for this great job first, guys !

I don't understand why the default search trigger input length is 2. Although it could be set on element, but really need hook to set the length for global application.

@bigtunacan
Copy link
Collaborator

@tinyfive Mostly just historical purposes and that it hasn't really been an issue for most people. It originally just defaulted to 2 (wasn't around back then; pretty arbitrary) about two years ago support to configure it at the element level.

If you want to have a go at a pull request to add this it seems like a useful feature.

@Startouf
Copy link

Are you talking about the minLength from which the autocompletion starts ? It would seem it's stuck after 3 letters for me and I can't find information on the doc. How do you change it per-field ? Is it reading data-attributes ? How can I pass it via html_options ?

@Genkilabs
Copy link

Genkilabs commented Oct 2, 2017

For other like @Startouf who end up here, you can set it per field with 'min-length'
Something like :'min-length' => 5, will generate something like
<input type="text" name="something_great" id="something_great" delay="1000" min-length="5" class="string form-control ui-autocomplete-input" placeholder="It's Great!" data-autocomplete="/something_great/autocomplete">

@ammarshah
Copy link

Thanks a ton @Genkilabs :)

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

No branches or pull requests

5 participants