vdw / HideSeek

A simple, mobile-friendly, yet customizable quick/live search jQuery plugin.
http://vdw.github.io/HideSeek
Apache License 2.0
429 stars 74 forks source link

Display results after a certain number of typed chars #26

Closed z3d0 closed 8 years ago

z3d0 commented 8 years ago

Hi, I have a list of 5000 elements and I need to show the results only after the user types at least 3 chars.

That's what I did:

$('#search').keypress(function() {

    var value=$.trim($("#search").val());

    if(value.length > 2 && isNaN(value))
    {
        $('#list').show();
    }   

});

the problem is that for every char that the user types, the list is updated in the background and that slows a lot the typing.

Thanks for any help

vdw commented 8 years ago

Hi,

at version 0.7.1 you can set the option min_chars to 3 (default value is 1) in order to set the minimum required characters to search.

E.g.

$('#search').hideseek({
    min_chars: 3
});

Thank you for your request, d

z3d0 commented 8 years ago

It works perfectly, thank you for your great work :)