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

Delay opened HoverCards do not cancel their open delay inside of DropdownMenus #2853

Open
hashboard-charlie opened this issue Apr 18, 2024 · 0 comments

Comments

@hashboard-charlie
Copy link

hashboard-charlie commented Apr 18, 2024

Bug report

Current Behavior

If you use a HoverCard with a openDelay inside of a DropdownMenu, the timer for the open delay fires even if you move the mouse to another item, resulting in the hover card appearing unexpectedly, and not being removed unless you interact with it again.

CleanShot.2024-04-18.at.15.21.03.mp4

Expected behavior

The HoverCard's openDelay timer should be cancelled if your mouse moves outside of the trigger area, even when being used inside of a DropdownMenu.

Reproducible example

CodeSandbox

Suggested solution

I think this is just a bug right? I don't see in what case this would be intended behavior.

Additional context

The underlying desire here is I want some hint text or popup text to appear after a delay in a dropdown menu. I don't care whether that's backed by HoverCard or Tooltip or whatever else. I had originally tried with a Tooltip, but that doesn't work for reasons discussed in #1920. So I moved on to trying with a different component, and ran into this. I'd really settle for any workaround for "I want to show some contextual information about a dropdown item only after a delay".

Your environment

Software Name(s) Version
Radix Package(s) @radix-ui/react-hover-card, @radix-ui/react-dropdown-menu (both latest) 1.0.7, 2.0.6
React n/a 17.0.1
Browser Chrome 123.0.6312.124
Assistive tech n/a
Node n/a
npm/yarn npm 10.2.4
Operating System macOS 14.2 (23C64)
@hashboard-charlie hashboard-charlie changed the title Delay opened HoverCards do not cancel their open delay correctly inside of DropdownMenus Delay opened HoverCards do not cancel their open delay inside of DropdownMenus Apr 18, 2024
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

1 participant