Skip to content

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/@react-spectrum/s2/src/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ const tooltip = style<TooltipRenderProps & {colorScheme: ColorScheme | 'light da
opacity: {
isEntering: 0,
isExiting: 0
},
overflowWrap: {
default: 'break-word'
}
});

Expand Down
8 changes: 7 additions & 1 deletion packages/@react-spectrum/s2/style/properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@
"textWrap": "__W",
"touchAction": "__X",
"translate": "__Y",
"wordBreak": "__Z"
"wordBreak": "__Z",
"overflowWrap": "__0"
},
"values": {
"--iconPrimary": {
Expand Down Expand Up @@ -2150,6 +2151,11 @@
"break-all": "a",
"keep-all": "b",
"normal": "c"
},
"overflowWrap": {
"normal": "a",
"anywhere": "b",
"break-word": "c"
}
},
"conditions": {
Expand Down
3 changes: 2 additions & 1 deletion packages/@react-spectrum/s2/style/spectrum-theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,8 @@ export const style = createTheme({
hyphens: ['none', 'manual', 'auto'] as const,
whiteSpace: ['normal', 'nowrap', 'pre', 'pre-line', 'pre-wrap', 'break-spaces'] as const,
textWrap: ['wrap', 'nowrap', 'balance', 'pretty'] as const,
wordBreak: ['normal', 'break-all', 'keep-all'] as const, // also overflowWrap??
wordBreak: ['normal', 'break-all', 'keep-all'] as const,
overflowWrap: ['normal', 'anywhere', 'break-word'] as const,
boxDecorationBreak: ['slice', 'clone'] as const,

// effects
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,8 @@ export const style = createTheme({
hyphens: ['none', 'manual', 'auto'] as const,
whiteSpace: ['normal', 'nowrap', 'pre', 'pre-line', 'pre-wrap', 'break-spaces'] as const,
textWrap: ['wrap', 'nowrap', 'balance', 'pretty'] as const,
wordBreak: ['normal', 'break-all', 'keep-all'] as const, // also overflowWrap??
wordBreak: ['normal', 'break-all', 'keep-all'] as const,
overflowWrap: ['normal', 'anywhere', 'break-word'] as const,
boxDecorationBreak: ['slice', 'clone'] as const,

// effects
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ function handleProperty(element: string, property: string, value: t.ObjectProper
case 'whiteSpace':
case 'textWrap':
case 'wordBreak':
case 'overflowWrap':
case 'boxDecorationBreak':
case 'forcedColorAdjust':
case 'backgroundPosition':
Expand Down