discussions-and-proposals icon indicating copy to clipboard operation
discussions-and-proposals copied to clipboard

Feature request: image pasting in textinput

Open divyanshu-patil opened this issue 1 month ago • 0 comments

Introduction

React Native’s TextInput currently supports only textual pasting and lacks native support for pasting images, stickers, GIFs, and rich content from system clipboards and modern keyboards (e.g., Gboard, Samsung Keyboard, iOS pasteboard).
This limitation prevents developers from building modern rich-text editors, chat applications, notes apps, and productivity tools that need to handle multimedia paste actions.

Native platforms provide this capability:

  • Android: via InputConnectionCompat#onCommitContent (for Gboard stickers, screenshots, GIFs) and onTextContextMenuItem(android.R.id.paste)
  • iOS: via overrides to paste: and access to UIPasteboard.general (image, video, GIF, etc.)

React Native does not surface these events to JS, making it impossible to implement image-pasting without writing a custom native component.

Details

This discussion proposes adding a standardized way for React Native apps to:

  1. Detect when an image or other rich content is pasted into a TextInput
  2. Receive the content in JS as a URI, base64, or temporary file path
  3. Handle content insertion manually, similar to how onChangeText exposes text

A minimal API surface could look like:

<TextInput
  onPasteImage={(event) => {
    console.log(event.nativeEvent.uri);   // file:// or content:// or base64
    console.log(event.nativeEvent.mime);  // image/png, image/webp, image/gif
  }}
/>

divyanshu-patil avatar Nov 24 '25 20:11 divyanshu-patil