diff --git a/docs/docs/api-reference/enriched-text-input.md b/docs/docs/api-reference/enriched-text-input.md index 357d1b15e..382e60a39 100644 --- a/docs/docs/api-reference/enriched-text-input.md +++ b/docs/docs/api-reference/enriched-text-input.md @@ -59,6 +59,7 @@ interface EnrichedTextInputProps extends Omit { onChangeHtml?: (e: NativeSyntheticEvent) => void; onChangeState?: (e: NativeSyntheticEvent) => void; onLinkDetected?: (e: OnLinkDetected) => void; + onLinkPress?: (event: OnLinkPressEvent) => void; onMentionDetected?: (e: OnMentionDetected) => void; onStartMention?: (indicator: string) => void; onChangeMention?: (e: OnChangeMentionEvent) => void; @@ -427,6 +428,23 @@ interface OnLinkDetected { | --------------------------------- | ----------------- | | `(event: OnLinkDetected) => void` | Android, iOS, Web | +### `onLinkPress` {#onlinkpress} + +Called when the user clicks a link inside the editor. Receives an +`OnLinkPressEvent` containing the link's URL. If not provided, clicking a link +has no effect. See [Links](/rich-text-formatting/links) for more on how links +are created and detected. + +```ts +interface OnLinkPressEvent { + url: string; +} +``` + +| Type | Platforms | +| ----------------------------------- | --------- | +| `(event: OnLinkPressEvent) => void` | Web | + ### `onMentionDetected` {#onmentiondetected} Called when the diff --git a/docs/docs/rich-text-formatting/links.mdx b/docs/docs/rich-text-formatting/links.mdx index 8eb27f075..556ace638 100644 --- a/docs/docs/rich-text-formatting/links.mdx +++ b/docs/docs/rich-text-formatting/links.mdx @@ -135,10 +135,11 @@ while editing an autolinked token breaks it. ## Handling links with events -There are two events that allow you to handle user interaction with links, one in each component. +There are a few events that allow you to handle user interaction with links. In `EnrichedTextInput`: - [**`onLinkDetected`**](/api-reference/enriched-text-input#onlinkdetected) fires when the cursor enters or leaves a created link. +- [**`onLinkPress`**](/api-reference/enriched-text-input#onlinkpress) fires when the user clicks a link. Available only on Web. In `EnrichedText`: - [**`onLinkPress`**](/api-reference/enriched-text#onlinkpress) fires when the user presses a link.