Skip to content

Commit

Permalink
fix: copy number with text format to a cell with text format
Browse files Browse the repository at this point in the history
  • Loading branch information
GazeWilly committed Sep 7, 2023
1 parent 71aa043 commit 25e0525
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/core/src/events/paste.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1498,6 +1498,11 @@ export function handlePaste(ctx: Context, e: ClipboardEvent) {
// }
const allowEdit = isAllowEdit(ctx);
if (!allowEdit) return;
if ((ctx.luckysheet_select_save?.length ?? 0) !== 1) return;
const minh = ctx.luckysheet_select_save![0].row[0];
const minc = ctx.luckysheet_select_save![0].column[0];
const flowdata = getFlowdata(ctx);
if (!flowdata) return;

if (selectionCache.isPasteAction) {
ctx.luckysheetCellUpdate = [];
Expand Down Expand Up @@ -1719,7 +1724,9 @@ export function handlePaste(ctx: Context, e: ClipboardEvent) {
} else {
const mask = genarate(txt);
// @ts-ignore
[cell.m, cell.ct, cell.v] = mask;
[cell.m, cell.ct, cell.v] = flowdata[r + minh][c + minc]?.ct?.fa
? [txt, flowdata[r + minh][c + minc]?.ct, txt]
: mask;
}
const styleString =
typeof allStyleList[`.${className}`] === "string"
Expand Down

0 comments on commit 25e0525

Please sign in to comment.