Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Add minimumInputLength option #1291

Merged

Conversation

giorgiofellipe
Copy link
Contributor

Should be added as "minimum-input-length" on ui-select-choices directive

You can see a working version here (first select only):
http://plnkr.co/edit/vd0qiDmGuvOa8CfrCy5s?p=preview

This fixes #161.

Let me know if there's something wrong or something to improve.

Shoul be added as "minimum-input-length" on ui-select-choices directive
@aaronroberson aaronroberson merged commit 7bcab96 into angular-ui:master Jan 25, 2016
@mrkrstphr
Copy link

Was the intention to make the drop down list not appear until X number of characters were entered? The attribute seems to work properly, but I would expect to be able to open the drop down and view the list of options without typing anything.

See here: http://plnkr.co/edit/0RLT56xQhKPSfunPenHP?p=preview

@giorgiofellipe
Copy link
Contributor Author

@mrkrstphr IMO its okay, because the intention was to not make many requests without being necessary.

But I got what you meant, we shouldn't validate this attribute when we're using static items (without refresh function), am I right?
I've made this change http://plnkr.co/edit/OUQF2XBxjNefpOTNnEY7?p=preview
But it will be kind of confusing, why we're setting minimum input length without validating it when we're not using a refresh function?

@mrkrstphr
Copy link

My exact use case is that we have a ui-select for gender, with Male and Female, and wanted the user to be able to type F or M and have it jump to that gender, but by default it required two characters. However, with this attribute, it "breaks" it for users who just try to pop open the select and pick a value.

But I agree that the current behavior makes sense when loading the data from a remote source.

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

Successfully merging this pull request may close these issues.

Is there a way to set minimumInputLength?
3 participants