lexical-ios icon indicating copy to clipboard operation
lexical-ios copied to clipboard

Ability to handle paste for images in editor

Open morajabi opened this issue 1 year ago • 3 comments

It would be awesome if we could allow use to paste an image (copied from Photos, Safari, etc) and we'd receive the event in a listener. I would like to initiate an image upload when user pastes an image. Is there any workaround for this?

morajabi avatar Feb 17 '24 13:02 morajabi

There is already a 'PASTE_COMMAND' that gets fired upon the action, so you can define your handling of images (upload to S3, etc in there)

Edit: Realized it's lexical-ios, not sure if it applies here, but since 'PASTE_COMMAND' is part of the Lexical core, I'd assume this still applies, but haven't worked with this one.

ivailop7 avatar Feb 17 '24 15:02 ivailop7

@ivailop7 Nice, but still I don't get the option to paste when I tap on the lexical editor if I only have image in my pasteboard.

IMG_CCE2BCEF4149-1

morajabi avatar Feb 17 '24 15:02 morajabi

I see. Not familiar with the mechanics here. Sorry.

ivailop7 avatar Feb 17 '24 19:02 ivailop7