Doist / reactist

Open source React components made with ❤️ by Doist
http://doist.github.io/reactist
MIT License
248 stars 22 forks source link

fix: Allow z-index override for Tooltip #747

Closed frankieyan closed 1 year ago

frankieyan commented 1 year ago

Short description

This allows Tooltip to have its z-index overridden, as it can end up being hidden behind elements on a higher z-index:

image

PR Checklist

Versioning

Patch

gnapse commented 1 year ago

@frankieyan while you're at it, this PR is a great opportunity to add a new style to tooltips that is being requested: setting a max-width for them, as requested here.

Yes, a tooltip width limit would be great. In our library we have it set to 250px. Maybe 300px works too 🤔

Do you think we can slip in that change here? It would be hardcoded in the tooltip styles. I do not think we need to give the ability to customize this via a CSS variable. But maybe we do, and you prefer to do it that way. What do you think?

frankieyan commented 1 year ago

while you're at it, this PR is a great opportunity to add a new style to tooltips that is being requested: setting a max-width for them, as requested here.

I don't mind doing it, but I don't think we should include it in the changes here to keep it focused. I'll create a separate PR.