MCPcopy Create free account
hub / github.com/GraphiteEditor/Graphite / onPaste

Function onPaste

frontend/src/utility-functions/input.ts:265–274  ·  view source on GitHub ↗
(e: ClipboardEvent, editor: EditorWrapper)

Source from the content-addressed store, hash-verified

263}
264
265export function onPaste(e: ClipboardEvent, editor: EditorWrapper) {
266 const dataTransfer = e.clipboardData;
267 if (!dataTransfer || targetIsTextField(e.target || undefined)) return;
268 e.preventDefault();
269
270 Array.from(dataTransfer.items).forEach(async (item) => {
271 if (item.type === "text/plain") item.getAsString((text) => editor.pasteText(text));
272 await pasteFile(item, editor);
273 });
274}
275
276export function onFocusOut() {
277 canvasFocused = false;

Callers 1

input.tsFile · 0.90

Calls 3

pasteFileFunction · 0.90
targetIsTextFieldFunction · 0.85
fromMethod · 0.45

Tested by

no test coverage detected