Skip to content

Commit ec9d29f

Browse files
committed
docs: split notes / mention enrichedText press events
1 parent 77cc418 commit ec9d29f

2 files changed

Lines changed: 25 additions & 5 deletions

File tree

docs/docs/rich-text-formatting/links.mdx

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,18 @@ const linkRegex = /issue-\d+/g;
3636
<EnrichedTextInput linkRegex={linkRegex} /* ... */ />;
3737
```
3838

39+
:::tip
40+
41+
You can pass `null` to turn automatic detection
42+
off entirely.
43+
44+
:::
45+
3946
:::note
4047

4148
On iOS and Android the pattern is matched by the platform's native regex engine,
4249
so not every JavaScript regex feature is available there - variable-width
43-
lookbehinds, for instance, won't work. Pass `null` to turn automatic detection
44-
off entirely.
50+
lookbehinds, for instance, won't work.
4551

4652
:::
4753

@@ -90,8 +96,14 @@ const addLink = () => {
9096
:::tip
9197

9298
Passing a different `text` than what's selected replaces the selected text before
93-
applying the link. To strip a link while keeping its text, call
94-
`removeLink(start, end)`.
99+
applying the link.
100+
101+
:::
102+
103+
:::tip
104+
105+
To strip a link while keeping its text,
106+
you can call `removeLink(start, end)`.
95107

96108
:::
97109

@@ -115,10 +127,14 @@ while editing an autolinked token breaks it.
115127

116128
## Handling links with events
117129

118-
There is an event that allows you to handle user's interaction with links inside `EnrichedTextInput`.
130+
There are two events that allows you to handle user interaction with links, one in each component.
119131

132+
In `EnrichedTextInput`:
120133
- **`onLinkDetected`** fires when the cursor enters or leaves a created link.
121134

135+
In `EnrichedText`:
136+
- **`onLinkPress`** fires when the user presses a link.
137+
122138
:::info
123139

124140
This page covers creating and detecting links. To change how

docs/docs/rich-text-formatting/mentions.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ call `setMention` when the user picks someone. This example doesn't wire up any
8989
of that; the full picker flow is covered end-to-end in the
9090
[Mention-only input](/guides/mention-only-input) guide.
9191

92+
The read-only `EnrichedText` also emits an event you can use to handle user interaction:
93+
94+
- **`onMentionPress`** fires when the user presses a mention.
95+
9296
:::tip
9397

9498
Prefix your custom attribute names with `data-` (e.g. `{ 'data-profile-url': user.profileUrl }`).

0 commit comments

Comments
 (0)