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

minChars 0 doesn't detect change on input #75

Open
edraobdu opened this issue Sep 8, 2017 · 0 comments
Open

minChars 0 doesn't detect change on input #75

edraobdu opened this issue Sep 8, 2017 · 0 comments

Comments

@edraobdu
Copy link

edraobdu commented Sep 8, 2017

Hi.
When minChars is 0, by focus on the input it shows all the options, but, by clicking on any option the event "change" of the input doesn't work. It works only if I type for searching, but not at the first time when it shows all the options.

Using the demo:

$('#hero-demo').autoComplete({
                minChars: 0,
                source: function(term, suggest){
                    term = term.toLowerCase();
                    var choices = ['ActionScript', 'AppleScript', 'Asp', 'Assembly', 'BASIC', 'Batch', 'C', 'C++', 'CSS', 'Clojure', 'COBOL', 'ColdFusion', 'Erlang', 'Fortran', 'Groovy', 'Haskell', 'HTML', 'Java', 'JavaScript', 'Lisp', 'Perl', 'PHP', 'PowerShell', 'Python', 'Ruby', 'Scala', 'Scheme', 'SQL', 'TeX', 'XML'];
                    var suggestions = [];
                    for (i=0;i<choices.length;i++)
                        if (~choices[i].toLowerCase().indexOf(term)) suggestions.push(choices[i]);
                    suggest(suggestions);
                }
            }).on('change', function(){
    window.alert('hey Apple');
});

I'd appreciate any help, thanks!

@edraobdu edraobdu closed this as completed Sep 8, 2017
@edraobdu edraobdu reopened this Sep 8, 2017
@edraobdu edraobdu changed the title minChars 0 don't detect change on input minChars 0 doesn't detect change on input Sep 8, 2017
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

1 participant