Radix-like Hover Card using Popover + modifications to useSafelyMouseToSubmenu? #8830
schurchleycci
started this conversation in
Ideas
Replies: 1 comment
-
Thanks for the discussion. Linking a previous relevant discussion #5126 We are hesitant to expose something like this because of the accessibility concerns and how many users are locked out from this functionality. You've also pointed out some interesting issues with focus management. Overlays are focus traps, so if you opened one of these on focus, it might be hard to close it for a keyboard user. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Radix has a HoverCard component that would be nice to be able to implement with react aria components. I understand that hover interactions should be avoided where possible, since they're not accessible to all input types, but there are some scenarios where a HoverCard-like component would be nice to have - e.g. a "preview" of the content that a user would see if they clicked a link. A tooltip could be used for this, but then interactive content couldn't be used. Flyout menus could also possibly be implemented similarly, since they typically open on hover and expose interactive content like links.
At first glance, it appears you could do this with the controlled open state of a Popover, setting it when the trigger element is hovered or focused. To do it well, however, it'd be nice to be able to safely move the mouse from the popover trigger to the popover - which feels very much like what the useSafelyMouseToSubmenu hook does. A couple questions:
useSafelyMouseToSubmenu
to something likeuseSafelyMouseToOverlay
? The implementation looks pretty generic already since it's based on the menu and submenu refs, so generalizing it might not be much more than renamingmenu
to something liketrigger
andsubmenu
to something likeoverlay
. But I may be missing something!Beta Was this translation helpful? Give feedback.
All reactions