-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix: S2 Prevented Tooltip text overflowing by default #8527
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
base: main
Are you sure you want to change the base?
fix: S2 Prevented Tooltip text overflowing by default #8527
Conversation
@@ -167,7 +167,7 @@ export const Tooltip = forwardRef(function Tooltip(props: TooltipProps, ref: DOM | |||
placement={placement} | |||
shouldFlip={shouldFlip} | |||
ref={tooltipRef} | |||
style={UNSAFE_style} | |||
style={{overflowWrap: 'break-word', ...UNSAFE_style}} |
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.
you'll want to add this style to the tooltip
style (classname one line below is where that is used, it's a style macro), not to the inline style for the element
See https://react-spectrum.adobe.com/s2/index.html?path=/docs/style-macro--docs for more info on style macros
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.
I considered that, but currently there isn't support there for overflowWrap
in React Spectrum v3 and S2. Is this an addition we want to add support for here, and would that require additional documentation changes etc?
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.
yeah, looks like the comment suggests we should add it
"overflowWrap": "__0", | ||
"--fs": "__1" |
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.
"overflowWrap": "__0", | |
"--fs": "__1" | |
"--fs": "__0", | |
"overflowWrap": "__1" |
@devongovett i think this has to be like this to keep it stable across versions?
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.
Should we just swap the value as you suggested @snowystinger to be safe, and move on?
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.
I think @devongovett typically generates this file with some script, so i do still want him to weigh in as i don't think it's meant to be manually updated
Closes #8514
✅ Pull Request Checklist:
📝 Test Instructions:
Create a Tooltip with long non-breaking text
Before:
After:
🧢 Your Project: