Skip to content

Feature request: image pasting in textinput #960

@divyanshu-patil

Description

@divyanshu-patil

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
  }}
/>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions