Skip to content
Snippets Groups Projects

Add onCopy callback to CopyableText

Merged Administrator requested to merge philipp-spiess/on-copy-callback into main

Created by: philipp-spiess

Part of https://github.com/sourcegraph/sourcegraph/issues/27101

This PR is based on top of https://github.com/sourcegraph/sourcegraph/pull/30591 to avoid merge conflicts (we'll land them together anyway).

In order to log events around when invite links are copied, we need a callback from the <CopyableText /> component. Notice that there are two paths to copying text: Either by clicking the button or by focusing the text. This onCopy callback is emitted on both paths.

I tested the changes by adding an onClick={() => console.log("onCopy called")} prop to the caller in StartSearching.tsx and it worked as expected:

Screenshot 2022-02-03 at 13 03 22

Merge request reports

Merged by avatar (Jul 6, 2025 5:13pm UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading