Skip to content

Conversation

@anton-github
Copy link
Contributor

We have to remove class from first suggestion element, not from every first children. Otherwise, in case of a grouped list, first item never lose selected state.

We have to remove class from first suggestion element, not from every first children. Otherwise, in case of a grouped list, first item never lose selected state.
@tkirda
Copy link
Member

tkirda commented Dec 11, 2017

first() will always return only one element. Can you explain how to reproduce the issue that you are trying to correct here?

@anton-github
Copy link
Contributor Author

anton-github commented Dec 11, 2017

Sorry for the unclear description :(

What I am trying to say is if you have a list of suggestions without groups keyboard navigation and in particular moveUp method work just fine because $(that.suggestionsContainer).children().first() returns suggestion element. But in case of a grouped list, first element of suggestionsContainer is a group element not suggestion. So by executing $(that.suggestionsContainer).children().first().removeClass(that.classes.selected) we remove class from group but we want to remove it from suggestion.

You can see bug here, just start type "ch" and then try to go to the bottom of the list and back by keyboard.
https://jsfiddle.net/slphd/hokrb35t/5/

@tkirda
Copy link
Member

tkirda commented Dec 11, 2017

Yes, you right.

@tkirda tkirda merged commit 16e1344 into devbridge:master Dec 11, 2017
ivanmtw added a commit to ivanmtw/jQuery-Autocomplete that referenced this pull request Feb 10, 2018
Last versions of Google Chrome ignore property 'autocomplete="off"'. We need change it to 'autocomplete="new-password"' for disabling internal
Chrome autofill feature when plugin initialized. It works for any text fields, not only for password text fields.

Change
            // Remove autocomplete attribute to prevent native suggestions:
            that.element.setAttribute('autocomplete', 'off');
to:
            // Remove autocomplete attribute to prevent native suggestions:
            that.element.setAttribute('autocomplete', 'new-password');

Proof: https://stackoverflow.com/questions/15738259/disabling-chrome-autofill

Fix devbridge#677
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

Successfully merging this pull request may close these issues.

2 participants