Skip to content

Tooltip inside a <p></p> results in a warning #210

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

Closed
ghost opened this issue Oct 19, 2016 · 4 comments
Closed

Tooltip inside a <p></p> results in a warning #210

ghost opened this issue Oct 19, 2016 · 4 comments

Comments

@ghost
Copy link

ghost commented Oct 19, 2016

It actually works, but the default tooltip wrapper is a <div>
And this makes it problematic to use it within a <p> tag.. In our case we need a tooltip for an img which is inner p tag.. we use span based template to show the tooltip content, but we get a warning message because the tooltip wrapper is a div.

Warning: validateDOMNesting(...): <div> cannot appear as a descendant of <p>. See ReactMarkdown > p > ... > Image > ItemIconWithTooltip > ReactTooltip > div.

@ghost ghost mentioned this issue Oct 19, 2016
@wwayne
Copy link
Collaborator

wwayne commented Feb 7, 2017

Thanks, merged the PR, will release in 3.2.4

@wwayne wwayne closed this as completed Feb 7, 2017
@joaoreynolds
Copy link

For future readers - to save the few minutes it took me to go read the docs. You can pass in the option wrapper="span" (default remains div) which will get around this error.

@Aryaman73
Copy link

Not sure if this is working as intended, but it looks like with wrapper="span" there is a p tag there, and I'm getting a similar error:

image

I'm using v4.2.21

@MilanLund
Copy link

MilanLund commented Jan 31, 2023

I am experiencing this issue too v5.7.1.
Using with Next.js App Directory inside a client component.

To give you more context. I am setting wrapper="span" and the resulting tooltip DOM element is still a div element.
image

EDIT 2/7/2023:
It looks like this issue has been resolved in v5.7.4.

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

4 participants