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

Dropdowns with links in them disappear on hover in develop mode #126

Open
rsexton404 opened this issue Dec 1, 2020 · 3 comments
Open

Dropdowns with links in them disappear on hover in develop mode #126

rsexton404 opened this issue Dec 1, 2020 · 3 comments

Comments

@rsexton404
Copy link
Contributor

rsexton404 commented Dec 1, 2020

If I have a dropdown in my header with a link in it it will disappear on hover just after first load the page—but only in develop mode. It works fine if there is just text content with no link components in the dropdown. Probably has something to do with the initial state of isOpen being handled differently in develop mode.

Here's a quick screen recording of the issue:
2020-12-01 01 10 55

@rsexton404
Copy link
Contributor Author

rsexton404 commented Dec 2, 2020

BTW, this only seems to happen if the dropdown contains a <Link> component. If you swap it out an <a> tag it doesn't disappear.

@shadcn
Copy link
Contributor

shadcn commented Dec 2, 2020

I'll take a look at this. Thank you.

@rsexton404
Copy link
Contributor Author

I noticed that only hovering over a <Link> whose route is not the current page will cause the issue. Also, if you try opening the dropdown again and hover over that same link again, it will not disappear (unless you hover any other links that aren't routing to the current page and haven't been hovered over once yet). I don't quite get how that would cause the whole parent component to re-render (with the isOpen set to its initial state of false), but I hope that helps!

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

No branches or pull requests

2 participants