Skip to content
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "fix: paste to table performance when has prepared edit cell #4912\n\n",
"type": "none",
"packageName": "@visactor/vtable"
}
],
"packageName": "@visactor/vtable",
"email": "[email protected]"
}
10 changes: 10 additions & 0 deletions packages/vtable-editors/src/input-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ export class InputEditor implements IEditor {
};
input.addEventListener('wheel', wheelHandler);
this.eventHandlers.push({ type: 'wheel', handler: wheelHandler });

const pasteHandler: EventListener = (e: Event) => {
const pasteEvent = e as ClipboardEvent;
// 在prepare阶段(opacity为'0'时)禁止粘贴
if (this.element.style.opacity === '0') {
pasteEvent.preventDefault();
}
};
input.addEventListener('paste', pasteHandler);
this.eventHandlers.push({ type: 'paste', handler: pasteHandler });
}

setValue(value: string) {
Expand Down
Loading