Skip to content

feat: add selectionMenuConfig prop to EnrichedMarkdownTextInput#408

Merged
hryhoriiK97 merged 3 commits into
mainfrom
feat/input-selection-menu-config
Jun 19, 2026
Merged

feat: add selectionMenuConfig prop to EnrichedMarkdownTextInput#408
hryhoriiK97 merged 3 commits into
mainfrom
feat/input-selection-menu-config

Conversation

@hryhoriiK97

@hryhoriiK97 hryhoriiK97 commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

What/Why?

Adds a new selectionMenuConfig prop to EnrichedMarkdownTextInput that lets consumers control the visibility of built-in items in the text selection context menu:

  • format — toggle the "Format" submenu on/off
  • copyAsMarkdown — toggle the "Copy as Markdown" action on/off

Both fields default to true, so existing behavior is preserved when the prop is omitted. This addresses #407.

Platforms: iOS, Android, macOS

Testing

Screenshots

Screen.Recording.2026-06-19.at.11.53.03.mov

PR Checklist

  • Code compiles and runs on iOS
  • Code compiles and runs on Android
  • Updated documentation/README if applicable
  • Ran example app to verify changes
  • E2E tests are passing
  • Required E2E tests have been added (if applicable)

…arkdownTextInput

Co-authored-by: Cursor <cursoragent@cursor.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a selectionMenuConfig prop to EnrichedMarkdownTextInput so consumers can independently show/hide the built-in Format submenu and Copy as Markdown action across iOS/Android/macOS, while preserving existing behavior by default.

Changes:

  • Adds selectionMenuConfig?: { format?: boolean; copyAsMarkdown?: boolean } to the JS EnrichedMarkdownTextInput API, normalizes defaults to { format: true, copyAsMarkdown: true }, and forwards to native.
  • Implements native gating for these built-in menu items on iOS/macOS (Edit Menu / NSMenu) and Android (ActionMode menu).
  • Updates docs to describe the new prop for the input component.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/react-native-enriched-markdown/src/index.tsx Re-exports the new InputSelectionMenuConfig type.
packages/react-native-enriched-markdown/src/EnrichedMarkdownTextInputNativeComponent.ts Adds the codegen prop shape (selectionMenuConfig) for the native component.
packages/react-native-enriched-markdown/src/EnrichedMarkdownTextInput.tsx Introduces the public prop/type, normalizes defaults, and passes config to native.
packages/react-native-enriched-markdown/ios/input/EnrichedMarkdownTextInput+Internal.h Defines ENRMInputSelectionMenuConfig and exposes accessor for context-menu code.
packages/react-native-enriched-markdown/ios/input/EnrichedMarkdownTextInput+ContextMenu.mm Conditionally inserts Format / Copy-as-Markdown menu items based on config.
packages/react-native-enriched-markdown/ios/input/EnrichedMarkdownTextInput.mm Stores/updates selection-menu config from props and exposes it to the category.
packages/react-native-enriched-markdown/android/src/main/java/com/swmansion/enriched/markdown/input/toolbar/InputContextMenu.kt Adds config model and hides Format/Copy-as-Markdown menu items accordingly.
packages/react-native-enriched-markdown/android/src/main/java/com/swmansion/enriched/markdown/input/EnrichedMarkdownTextInputManager.kt Wires the new prop from RN to the view’s context menu config.
docs/COPY_OPTIONS.md Documents using selectionMenuConfig on EnrichedMarkdownTextInput.
docs/API_REFERENCE.md Adds API reference section for EnrichedMarkdownTextInput.selectionMenuConfig.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hryhoriiK97 hryhoriiK97 requested a review from eszlamczyk June 19, 2026 09:54

@eszlamczyk eszlamczyk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hryhoriiK97 hryhoriiK97 merged commit c9fe6d1 into main Jun 19, 2026
4 checks passed
@hryhoriiK97 hryhoriiK97 deleted the feat/input-selection-menu-config branch June 19, 2026 11:48
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.

3 participants