Skip to content

Commit

Permalink
fix(sheet): copy&paste clip cell
Browse files Browse the repository at this point in the history
  • Loading branch information
AquaHydro committed Jul 15, 2024
1 parent 26af2cc commit 1604ce8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/shared/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ export function handleStyleToString(style: IStyleData, isCell: boolean = false)
'tb',
() => {
if (style.tb === WrapStrategy.CLIP) {
str += 'white-space: clip; ';
str += 'white-space: nowrap; overflow-x: hidden; ';
} else if (style.tb === WrapStrategy.WRAP) {
str += 'white-space: normal;';
}
Expand Down
26 changes: 14 additions & 12 deletions packages/ui/src/utils/cell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,18 +382,20 @@ export function handleStringToStyle($dom?: HTMLElement, cssStyle: string = '') {
}
}

// wrap text
if (key === 'overflow-wrap' || key === 'word-wrap') {
if (value === 'break-word') {
styleList.tb = 3;
}
} else if (key === 'text-overflow') {
if (value === 'clip') {
styleList.tb = 2;
}
} else if (key === 'text-break') {
if (value === 'overflow') {
styleList.tb = 1;
// wrap text (`white-space` property has a higher priority.)
if (styleList.tb !== 1) {
if (key === 'overflow-wrap' || key === 'word-wrap') {
if (value === 'break-word') {
styleList.tb = 3;
}
} else if (key === 'text-overflow') {
if (value === 'clip') {
styleList.tb = 2;
}
} else if (key === 'text-break') {
if (value === 'overflow') {
styleList.tb = 1;
}
}
}

Expand Down

0 comments on commit 1604ce8

Please sign in to comment.