Skip to content

Tooltip abstraction using Slot doesn't work with components #660

Discussion options

You must be logged in to vote

You need to React.forwardRef on your TestTrigger.

Without that, a ref cannot be attached to the actual DOM node so it cannot be measured, and thus the tooltip cannot be positioned.

Important to note also, the trigger should be an interactive element, most likely a button. If you make it a div like this, you are left with handling all the accessibility yourself.

Replies: 1 comment 11 replies

Comment options

You must be logged in to vote
11 replies
@uriklar
Comment options

@benoitgrelard
Comment options

@uriklar
Comment options

@benoitgrelard
Comment options

@andy-hook
Comment options

Answer selected by DaniGuardiola
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
4 participants