MCPcopy Create free account
hub / github.com/editablejs/editable / handlePaste

Function handlePaste

packages/editor/src/components/input.tsx:104–119  ·  view source on GitHub ↗
(event: React.ClipboardEvent)

Source from the content-addressed store, hash-verified

102 }
103
104 const handlePaste = (event: React.ClipboardEvent) => {
105 composeEventHandlers(
106 (event: React.ClipboardEvent) => {
107 if (ReadOnly.is(editor)) {
108 event.preventDefault()
109 }
110 },
111 event => {
112 const { nativeEvent } = event
113 const isPasteText = IS_PASTE_TEXT.get(editor)
114 event.preventDefault()
115 const e = new ClipboardEvent(isPasteText ? 'pasteText' : 'paste', nativeEvent)
116 editor.onPaste(e)
117 },
118 )(event)
119 }
120
121 const selection = useSelectionDrawingSelection()
122 const rects = useSelectionDrawingRects()

Callers

nothing calls this directly

Calls 2

composeEventHandlersFunction · 0.90
getMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…