Skip to content
Draft
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
2 changes: 2 additions & 0 deletions src/components/common/controllers/key-bindings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export const arrowLeft = 'ArrowLeft' as const;
export const arrowRight = 'ArrowRight' as const;
export const arrowUp = 'ArrowUp' as const;
export const arrowDown = 'ArrowDown' as const;
export const backspaceKey = 'Backspace' as const;
export const deleteKey = 'Delete' as const;
export const enterKey = 'Enter' as const;
export const spaceBar = ' ' as const;
export const escapeKey = 'Escape' as const;
Expand Down
13 changes: 13 additions & 0 deletions src/components/common/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,19 @@ export function simulateDoubleClick(node: Element): void {
);
}

export function simulatePaste(node: Element, pastedText: string): void {
const clipboardData = new DataTransfer();
clipboardData.setData('text/plain', pastedText);

node.dispatchEvent(
new ClipboardEvent('paste', {
bubbles: true,
composed: true,
clipboardData,
})
);
}

/**
* Returns an array of all Animation objects affecting this element or which are scheduled to do so in the future.
* It can optionally return Animation objects for descendant elements too.
Expand Down
Loading
Loading