-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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] Tooltip arrows are incompatible with text-wrap: pretty
#44563
Comments
@rileyjshaw I can reproduce the issue. I'm very surprised the arrow |
@aarongarciah I agree—surprising right? I just opened a PR with the fix: #44579. |
Could we report this to Chromium https://issues.chromium.org/issues?q=text-wrap%20pretty&p=1&s=status:asc&s=type:asc with a simplified test case and see what they say before we take any steps here? |
@oliviertassinari I can report this to Chromium, but is there any downside to merging this in the meantime? As far as I can tell, the spec is vague on how this should behave. |
Yes, I agree to wait for the response from Chromium first. |
@rileyjshaw Thanks. They seem to have confirmed it's a bug https://issues.chromium.org/issues/381270274?
I imagine there isn't a downside, we could try to merge this and see. It's more that it feels backward to fix something in the wrong abstraction layer. |
@oliviertassinari no problem! I’m glad Chromium is looking into it as well. I understand wanting to avoid extra code weight or complexity for an upstream issue. But since this change just swaps two elements with an arbitrary order, this feels like a safe and straightforward improvement to merge in the meantime. |
Maybe we can wait a few weeks to see the pace at which Chrome handle this. If they are too slow, we move forward here? We could also argue that we should fix this in https://master--base-ui.netlify.app/components/react-tooltip#arrow too. |
@oliviertassinari Base UI is unstyled (except very specific functional styles); I think Base UI should not care about this. |
@aarongarciah I see a few ways to look at this:
|
@oliviertassinari you're right, I misunderstood your comment. |
I propose to add a new prop to render the title at the end instead. This way, we have a workaround for v6 and add a comment that it might become the default behavior in v7 (based on how Chrome handles it). |
@siriwatknp what would be the advantage of a new prop? |
@oliviertassinari Chrome haven’t moved on this yet. And let me know if a PR to Base UI would be helpful!
@siriwatknp I can’t see much advantage to adding a prop. Aside from the specific |
Steps to reproduce
Steps:
text-wrap: pretty
being enabled.text-wrap: pretty
will now work as expected.Current behavior
The arrow
span
is interpreted as a word in thetext-wrap: pretty
layout algorithm.Expected behavior
The arrow
span
should not affect text wrapping.Context
I think the easiest way to fix this is to simply insert the arrow span before
{ children }
.Your environment
npx @mui/envinfo
Search keywords: tooltip, text-wrap, arrow
The text was updated successfully, but these errors were encountered: