The Wayback Machine - https://web.archive.org/web/20200930053106/https://github.com/algolia/autocomplete.js/issues/227
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

Autocomplete doesn't close on submit via Enter key (Safari and Firefox) #227

Open
TIIUNDER opened this issue May 3, 2018 · 1 comment
Open

Comments

@TIIUNDER
Copy link

@TIIUNDER TIIUNDER commented May 3, 2018

I'm using the Autocomplete (standalone) library on a form with a search input field. Submitting the form via Enter key doesn't close the Autocompletion box in Safari and Firefox. In Chrome it's working.

That's the used code:

var searchAutocomplete = autocomplete('#legal-search-term',
            {
                minLength: 3,
                hint: false,
                // debug: true, // TODO remove / does not close on blur
            }
            , searchIndexAutoCompleteObjects
        ).on('autocomplete:selected', function(event, suggestion, dataset) {
            // here happens some stuff
        });

I also tried the following workaroud:

jQuery('#legal-search').on('submit', function (e) {
        searchAutocomplete.autocomplete.close();
    });

But this workaround is only working once (why?)

@Haroenv
Copy link
Contributor

@Haroenv Haroenv commented May 4, 2018

Do you have other code dealing with the form or the input?

A template is available here for you to try to replicate the issue.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.