yuku / textcomplete

Autocomplete for HTMLTextAreaElement and more.
https://yuku.takahashi.coffee/textcomplete/
MIT License
1.74k stars 303 forks source link

Handle highlight with mouse events only #331

Closed dopatraman closed 4 years ago

dopatraman commented 4 years ago

Goal: The goal of this PR is to use javascript mouse events to highlight active elements in the emoji dropdown.

Summary: Right now, the first item of the emoji dropdown stays highlighted even when selecting other elements. The reason for that is that the current logic does not deactivate the first element when the dropdown is first shown. This PR deactivates all elements on every mouse movement.

mouseonly

dopatraman commented 4 years ago

pinging @yuku for visibility.

aki77 commented 4 years ago

This PR has broken the fix for #323. This is a weird behavior when the dropdown is made scrollable.

If you look at the behavior of GitHub's Mention input, for example, the behavior in v0.1.6 is more natural.

aki77 commented 4 years ago

@yuku @dopatraman

What do you think about the above behavior?

yuku commented 4 years ago

This is a weird behavior when the dropdown is made scrollable.

Thanks. I could reproduce the behavior:

0ac6fa7808eee45aaf83f77ae6d5785d

yuku commented 4 years ago

Because of my lack of interest on the project, I'd approved this PR by just watching the fancy gif in the PR description.

Now I had closer look at the patch and found some issues in that. (For example, I'd like to avoid using any whenever possible. I should have added a test case to confirm that. Its my bad 😞 )

So I'm going to revert this PR. Sorry for my inconsistency.

aki77 commented 4 years ago

Thanks! 🙏