-
Notifications
You must be signed in to change notification settings - Fork 23
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
Render Tooltip via React Portal #350
Conversation
render tooltip via react portal - new prop `container` closes issue #349
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think if we create a portal by default and attach it to the document.body
?
Our users won't even face the issue anymore in that case, the whole issue disappear. I don't see any negative sides on this solution
Good idea. We would need to put a big enough z-index on the tooltip then so that it gets rendered on top of modals. With my changes the responsibility for that is delegated to the user of the library which is not very convenient. I agree that it would be better if the library makes sure that it "just works".
Do you mean using |
Yes, I'd do that. In that case the z-index won't gonna be necessary because the tooltip will be sitting on top of the tree and in a separate stacking context |
The issue is that Modals come with |
remove new `container` prop and render tooltip body in any case via react portal directly to document.body with a z-index of 1300
I've removed the |
🎉 This PR is included in version 3.0.0-next.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What:
In this PR we're adding a new prop
container
to theTooltip
component where the tooltip should be rendered into.
Why:
This PR closes #349.
Tooltips that are rendered in Modal dialogs can cause scrollbars to appear. It was not like that in previous version of wave (1.15.1).
How:
container
to Tooltip component where the tooltip body should be rendered intocontainer
via react portal
Media:
Before:
After:
Checklist: