feat: add selectionMenuConfig prop to EnrichedMarkdownTextInput#408
Merged
Conversation
…arkdownTextInput Co-authored-by: Cursor <cursoragent@cursor.com>
252f84a to
b643a8b
Compare
There was a problem hiding this comment.
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 JSEnrichedMarkdownTextInputAPI, 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What/Why?
Adds a new
selectionMenuConfigprop toEnrichedMarkdownTextInputthat lets consumers control the visibility of built-in items in the text selection context menu:format— toggle the "Format" submenu on/offcopyAsMarkdown— toggle the "Copy as Markdown" action on/offBoth 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