-
-
Notifications
You must be signed in to change notification settings - Fork 79k
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
minLength option #3960
minLength option #3960
Conversation
…imum number of characters
this looks ok - but doesn't merge. can you update your request? thanks! |
What about combining the check with the next one? if (this.$element.val().length < this.minLength) {
return this.shown ? this.hide() : this
}
this.query = this.$element.val()
if (!this.query) {
return this.shown ? this.hide() : this
} To: this.query = this.$element.val()
if (!this.query || this.query.length < this.minLength) {
return this.shown ? this.hide() : this
} Otherwise, I think it would be a welcome change, especially since 2.1 will be able to handle async lookups. So, you could limit the number of calls. |
Does the data attribute for this need a capital L? If so, perhaps we could make it lowercase instead or even choose a different name. The capital would not only look a bit ugly but would confuse a lot of people and result in dozens of false bug reports. |
I merged the latest code from 2.1.0-wip and combined the 2 checks. I used the camel case for the naming and that's why the capital L. |
I understand why you used camel case but how does this affect the data attribute? |
What would you prefer? min-length? |
Refer to: http://blog.benpowell.co.uk/2012/03/warning-html5-data-attribute-is-case.html So basically, HTML5 data attributes must be all lowercase and they automatically map hyphen characters ( This means that in your case I guess this should be noted in the docs and then it's up to @fat whether he's happy to have the two slightly differing names or whether he thinks it might confuse people too much. |
Thanks for the clarification. I'll wait then to see if it's accepted. |
gah - super sorry, there was a bug in the unit test detection script i just ran. |
@@ -78,10 +79,10 @@ | |||
|
|||
, lookup: function (event) { | |||
var items | |||
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you remove the spaces here? thanks!
just went ahead and implemented it. thanks! |
Added option to only start querying only after user has entered a minimum number of characters