Skip to content

feat: add onCopyPress event for code block copy - #634

Draft
eszlamczyk wants to merge 2 commits into
feat/51/code-block-button-polishfrom
feat/51/code-block-copy-press-event
Draft

feat: add onCopyPress event for code block copy#634
eszlamczyk wants to merge 2 commits into
feat/51/code-block-button-polishfrom
feat/51/code-block-copy-press-event

Conversation

@eszlamczyk

@eszlamczyk eszlamczyk commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

What/Why?

Adds an onCopyPress({ code, language }) callback that fires when code is copied from a fenced code block (header button, context-menu Copy, or VoiceOver), so apps can react to copies. GitHub flavor only; does not fire for "Copy as Markdown".

Testing

Add onCopyPress={({ code, language }) => console.log(language, code.length)} to a flavor="github" block and confirm it fires for the header button and context-menu Copy (but not Copy as Markdown) on iOS and Android.

iOS Android

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)

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.

1 participant