signavio / react-mentions

@mention people in a textarea
https://react-mentions.vercel.app
Other
2.43k stars 567 forks source link

Mention selects item where mouse cursor happens to be, not top-most result #329

Open dep-deprecated opened 5 years ago

dep-deprecated commented 5 years ago

Steps to reproduce:

  1. Place your mouse over the area where the 2nd suggestion will appear (Single Line Input Example)
  2. Type @W
  3. Notice Skyler White's name is selected even though she's the second result
  4. Press enter and Skyler White gets inserted

Expected behaviour:

Would expect Walter White to be the inserted mention since he is the top typed result.

Workaround:

Move mouse away before doing a mention

Badbreaddead commented 5 years ago

any progress on this?

fnky commented 2 years ago

We've run into this issue as well, and have had users report to us that this behaviour is confusing and not desired. It's expected to work the same way as Downshift examples.

We aren't able to override the overlay component to provide our own dropdown logic (i.e. with Downshift).

fnky commented 2 years ago

It may be due to the use of onMouseEnter events, instead of onMouseMove. As noted in Downshift, onMouseEnter is triggered when DOM changes, rather than when mouse moves.