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

Fire awesomplete-highlight event only if some item was really highlighted #16872

Merged
merged 1 commit into from
Mar 16, 2016

Conversation

vlazar
Copy link
Collaborator

@vlazar vlazar commented Mar 16, 2016

When you move through the list with down/up keys awesomplete-highlight is now triggered even after you reach the latest item and press down key again or you reach the first item and press up key again.

In those 2 cases no item became highlighted, but awesomplete-highlight event is fired anyway. Is it a desired behavior or is it a bug?

@vlazar vlazar added this to the v1.1 milestone Mar 16, 2016

$.fire(this.input, "awesomplete-highlight", {
text: this.suggestions[this.index]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the end/before the beginning, when this.index = -1 the text would be undefined.

@vlazar vlazar mentioned this pull request Mar 16, 2016
LeaVerou added a commit that referenced this pull request Mar 16, 2016
Fire awesomplete-highlight event only if some item was really highlighted
@LeaVerou LeaVerou merged commit 52402fa into LeaVerou:gh-pages Mar 16, 2016
@LeaVerou
Copy link
Owner

Huh, no idea why it was like that, even though it was obviously intentional (otherwise I'd have put it in the conditional). Anyway, merged!
Thanks for spotting this!

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