Skip to content

Commit da510a4

Browse files
committed
docs: links and mention onDeteced events
1 parent e0f944c commit da510a4

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,15 @@ while editing an autolinked token breaks it.
104104

105105
<InteractiveExample src={LinksEditorSrc} component={LinksEditor} />
106106

107+
## Handling links with events
108+
109+
There is an event that allows you to handle user's interaction with links inside `EnrichedTextInput`.
110+
111+
- **`onLinkDetected`** fires when the cursor enters or leaves a created link.
112+
107113
:::info
108114

109-
This page covers creating and detecting links. To react to links the user
110-
touches, listen for the
111-
`onLinkDetected` event, and to change how
112-
links look, see [Styling the input](/core-functionalities/styling-the-input).
115+
This page covers creating and detecting links. To change how
116+
they look, see [Styling the input](/core-functionalities/styling-the-input).
113117

114118
:::

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,15 @@ space, and a second space ends it. That makes `@John Doe` a valid mention.
7474

7575
This example is deliberately bare-bones - one hard-coded user behind a button.
7676
A real app watches what the user types after the
77-
indicator and shows a picker. Three events give you everything you need for
77+
indicator and shows a picker. Four events give you everything you need for
7878
that:
7979

8080
- **`onStartMention`** fires when a mention starts - a good moment to open your suggestion list.
8181
- **`onChangeMention`** fires on every edit to the query, handing you the text
8282
typed after the indicator - use it to filter the list.
8383
- **`onEndMention`** fires when the mention stops being edited - the cursor
8484
moved away, or the query was closed - so you can dismiss the list.
85+
- **`onMentionDetected`** fires when the cursor enters or leaves a created mention.
8586

8687
You'd open the list on `onStartMention`, filter it on `onChangeMention`, and
8788
call `setMention` when the user picks someone. This example doesn't wire up any

0 commit comments

Comments
 (0)