Pasting rich content with a custom context menu

I’m working on an app where we’ve replaced the system context menu with a custom HTML one. We’ve been trying to figure out how to replicate paste events correctly—we can get the clipboard’s data with await navigator.clipboard.read(), but we’re not sure how to pass that output off to ProseMirror.

Poking around prosemirror-view, there are a few functions like capturePaste that seem useful but aren’t exported. Wondering if anybody has worked something out for a similar feature.

2 Likes

Does this patch look like it would help?

1 Like

Yes! This should be exactly what I need. Thank you so much.

Great. I’ve tagged 1.30.0

2 Likes