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

sl-tooltip content gets affected by styling #1947

Closed
Labels
bug Things that aren't working right in the library.

Comments

@jessicakjellin
Copy link

Describe the bug

The first bug I have discovered is that the content clips the tooltip-box when the parent-element has the styling "white-space: nowrap;".

Secondly, the text in the tooltip-box gets affected by text-align styling. This seems to only be a problem when the sl-tooltip element is in a table/td-element.

Please see the codepen-link for a demo.

To Reproduce

Steps to reproduce the first behavior:

  1. Surround the sl-tooltip with a div
  2. Apply styling "white-space: nowrap;" to this div

Steps to reproduce the second behavior:

  1. Have a sl-tooltip nestled in a td-element
  2. Apply the styling "text-align:right;" to the td-element

Demo

Codepen link:
https://codepen.io/noica/pen/bGJrPra

Screenshots

The first bug:
Screenshot 2024-03-28 at 14 10 10

The second bug:
Screenshot 2024-03-28 at 14 11 48

Browser / OS

  • OS: Mac
  • Browser: Chrome
  • Browser version: 123.0.6312.59
@jessicakjellin jessicakjellin added the bug Things that aren't working right in the library. label Mar 28, 2024
claviska added a commit that referenced this issue Mar 28, 2024
@claviska
Copy link
Member

Thanks for reporting this. Some text styles inherit through the shadow DOM by design, but we clearly don't want these ones to do that. Fixed in #1948.

@jessicakjellin
Copy link
Author

@claviska Thank you! I noticed that text-transform also leaks, e.g. text-transform: uppercase; on a parent makes the text in the tooltip uppercase. Is this supposed to leak through?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment