Skip to content

Commit d434b6d

Browse files
fix: S2 Prevented Tooltip text overflowing by default (#8527)
* fix: S2 Prevented Tooltip text overflowing by default * fix: Added overflowWrap property to style macros * revert: reverted changes to properties.json --------- Co-authored-by: Yihui Liao <[email protected]>
1 parent 51f9631 commit d434b6d

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

packages/@react-spectrum/s2/src/Tooltip.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ const tooltip = style<TooltipRenderProps & {colorScheme: ColorScheme | 'light da
101101
opacity: {
102102
isEntering: 0,
103103
isExiting: 0
104+
},
105+
overflowWrap: {
106+
default: 'break-word'
104107
}
105108
});
106109

packages/@react-spectrum/s2/style/spectrum-theme.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,8 @@ export const style = createTheme({
828828
hyphens: ['none', 'manual', 'auto'] as const,
829829
whiteSpace: ['normal', 'nowrap', 'pre', 'pre-line', 'pre-wrap', 'break-spaces'] as const,
830830
textWrap: ['wrap', 'nowrap', 'balance', 'pretty'] as const,
831-
wordBreak: ['normal', 'break-all', 'keep-all'] as const, // also overflowWrap??
831+
wordBreak: ['normal', 'break-all', 'keep-all'] as const,
832+
overflowWrap: ['normal', 'anywhere', 'break-word'] as const,
832833
boxDecorationBreak: ['slice', 'clone'] as const,
833834

834835
// effects

packages/@react-spectrum/style-macro-s1/src/spectrum-theme.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,8 @@ export const style = createTheme({
703703
hyphens: ['none', 'manual', 'auto'] as const,
704704
whiteSpace: ['normal', 'nowrap', 'pre', 'pre-line', 'pre-wrap', 'break-spaces'] as const,
705705
textWrap: ['wrap', 'nowrap', 'balance', 'pretty'] as const,
706-
wordBreak: ['normal', 'break-all', 'keep-all'] as const, // also overflowWrap??
706+
wordBreak: ['normal', 'break-all', 'keep-all'] as const,
707+
overflowWrap: ['normal', 'anywhere', 'break-word'] as const,
707708
boxDecorationBreak: ['slice', 'clone'] as const,
708709

709710
// effects

packages/dev/codemods/src/s1-to-s2/src/codemods/shared/unsafeStyle.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ function handleProperty(element: string, property: string, value: t.ObjectProper
365365
case 'whiteSpace':
366366
case 'textWrap':
367367
case 'wordBreak':
368+
case 'overflowWrap':
368369
case 'boxDecorationBreak':
369370
case 'forcedColorAdjust':
370371
case 'backgroundPosition':

0 commit comments

Comments
 (0)