Skip to content

what is mean this code? #43

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

Open
ddarkchu opened this issue Mar 15, 2017 · 4 comments · May be fixed by #94 or #95
Open

what is mean this code? #43

ddarkchu opened this issue Mar 15, 2017 · 4 comments · May be fixed by #94 or #95

Comments

@ddarkchu
Copy link

live('autocomplete-suggestion', 'mouseleave',
function(e){
var sel = that.sc.querySelector('.autocomplete-suggestion.selected');
if (sel) setTimeout(function(){ sel.className = sel.className.replace('selected', ''); }, 20);
}, that.sc);

What does this code mean?

I think it doesn't working.
Because that.sc and parent are not included "autocomplete-suggestion"
What do you think about it?

@TheCrimsonKing92
Copy link

As you mentioned, that handler never fired to deselect elements. I fixed the issue by changing the event type in the latest commits on my fork. Would you mind trying that to see if it solves your issue?

@ddarkchu
Copy link
Author

dear TheCrimsonKing92

What do you think about this change?
addEvent(that.sc, "mouseleave", function(e){
var sel = that.sc.querySelector('.autocomplete-suggestion.selected');
if (sel) setTimeout(function(){ sel.className = sel.className.replace(' selected', ''); }, 20);
});

@TheCrimsonKing92
Copy link

So the event is attached to that.sc rather than that? Perhaps that would fix the issue, if the event only bubbles to the parent. Does it work?

@ddarkchu
Copy link
Author

ddarkchu commented Mar 22, 2017

hi ~ TheCrimsonKing92.
that code worked.
The bubble to the parent seems to be inefficient and i was modified

This was referenced Oct 6, 2023
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 a pull request may close this issue.

2 participants