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

Tooltip creates invalid DOM nesting warnings #133

Open
lederer opened this issue Feb 13, 2019 · 0 comments
Open

Tooltip creates invalid DOM nesting warnings #133

lederer opened this issue Feb 13, 2019 · 0 comments
Labels
cleanup 🚿 Improving existing features

Comments

@lederer
Copy link
Contributor

lederer commented Feb 13, 2019

Per #128 (review)

There is a warning about invalid DOM nesting which I'd like to handle at some point in the future with another PR. It could have undesired outcomes in different browsers.

For example, currently, if you apply a tooltip in a button and have a button within that tooltip (see doc example), technically you have illegally nested buttons as far as browsers are concerned. But the way we ultimately render the component removes the nested structure in the DOM but only after the browser gives us a console warning. Since, at the end of the day, we aren't maintaining an illegal nesting structure, I propose we make an issue for this and fix it later.

Solution might involve using a portal.

Could also be a good opportunity to turn Tooltip into a hook (useTooltip). Maybe use it in Box so all components get it for free. Tooltip content could be passed in via a tooltip prop.

@lederer lederer added bug 🪲 Something isn't working cleanup 🚿 Improving existing features and removed bug 🪲 Something isn't working labels Feb 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup 🚿 Improving existing features
Development

No branches or pull requests

1 participant