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

fix: use mousemove to focus suggestion #619

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

fnky
Copy link

@fnky fnky commented Sep 6, 2022

Fixes #329

Replaces onMouseEnter with onMouseMove to prevent focusing mentions underneath the cursor, unless it was moved. This solves an issue where the wrong mention would be selected regardless of the query, if the cursor was above the overlay area.

While typing in the input and placing the cursor above the overlay area, should focus the matched mention. Moving the mouse over mentions should focus the mention underneath the cursor.

An edge-case that isn't always reproducible is that the previously focused mention will be focused when clearing the input, thus hiding the overlay, and typing again to show the overlay.

@changeset-bot
Copy link

changeset-bot bot commented Sep 6, 2022

🦋 Changeset detected

Latest commit: fc51414

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
react-mentions Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Sep 6, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
react-mentions ✅ Ready (Inspect) Visit Preview Sep 15, 2022 at 3:07PM (UTC)

@stianjensen
Copy link

Why are there changes to the yarn.lock file, and is the forwardRef needed here?

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.

Mention selects item where mouse cursor happens to be, not top-most result
3 participants