`handleDOMEvents.paste` and `handlePaste` don't fire if only a image is selected?

When we try to paste over an image it simply doesn’t fire. It fires all the rest of the time.

Is this just a hard limitation?

I realized this can potentially be addressed via keydown alone since the native context menu doesn’t support pasting over images via right-click. Messy, but should work.

This isn’t something I’m aware of, or that I can reproduce. Can you show a minimal demo that shows the issue? Does it occur on all browsers, or just some?

Ah okay, this one is even weirder than I’d thought, and very niche.

I must have been using Ctrl+Shift+V because I was also playing around with modifying paste events when Shift is held.

It appears that when you use Ctrl+Shift+V over an image that’s between two other images, then the paste events won’t fire. The images in our editor are block-level rather than inline.

If you can’t reproduce that on your side and you feel that it’s worth looking into, I’d be happy to create a repro, but I don’t have the expertise to create a pure ProseMirror repro - only nested within TipTap. If you’d like to see such a repro let me know and I can try to reproduce it.

For a visual example, paste and handlePaste won’t fire when pasting over this middle image:


Oh sorry - to answer your other question, it seems this may only affect Chrome. I couldn’t reproduce it in Firefox.

That seems like it might be a browser bug. You could try opening an issue here.

1 Like

Thanks for the advice - I think you’re right.

Just to document my issue better; I noticed I was able to reproduce this with plain Ctrl+V (no shift) if there are two images on either side instead of just one as in my image above.