Skip to content

Feat: disableImagePasting Prop#32

Merged
divyanshu-patil merged 2 commits intomainfrom
feat/new_props
Jan 2, 2026
Merged

Feat: disableImagePasting Prop#32
divyanshu-patil merged 2 commits intomainfrom
feat/new_props

Conversation

@divyanshu-patil
Copy link
Owner

@divyanshu-patil divyanshu-patil commented Jan 2, 2026

Description

This PR introduces a new prop, disableImagePasting, that allows consumers to prevent users from pasting images into the text input.

When enabled, image content from the system clipboard is blocked, ensuring the input accepts text-only content.

Issue

Closes: #31


Behavior Overview

iOS

  • When disableImagePasting={true}:
    • Image pasting is completely disabled
    • The Paste option does not appear in the context menu when the clipboard contains only images
    • Text pasting continues to work as expected
  • Behavior aligns with native iOS applications (Notes, Messages, WhatsApp)

Android

  • When disableImagePasting={true}:
    • Sticker and GIF options are disabled
    • Image paste handling is blocked at the input level
    • ⚠️ The Paste option may still be visible in the context menu due to Android framework limitations
      • Android does not provide a reliable API to conditionally hide the Paste action based on clipboard content

What This Solves

  • Prevents accidental or unwanted image insertion
  • Enforces text-only input constraints
  • Improves UX consistency across controlled editors
  • Avoids unexpected attachment uploads

Use Cases

  • Chat inputs where images are shared via a dedicated attachment button
  • Command or terminal-style inputs
  • Markdown or code editors that only accept text
  • Form fields (comments, feedback, reports) that disallow media
  • Enterprise or moderation-restricted applications
  • Search bars and single-line text inputs
  • subscription plans based image pasting

API Usage

<TypeRichTextInput
  disableImagePasting={true}
/>

@divyanshu-patil divyanshu-patil merged commit 8acad55 into main Jan 2, 2026
5 checks passed
@divyanshu-patil divyanshu-patil deleted the feat/new_props branch January 2, 2026 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature request: disableImagePasting prop

1 participant