Skip to content

Commit 63e9ad8

Browse files
committed
Revert "docs: revert docs update"
This reverts commit 685b8ad.
1 parent 685b8ad commit 63e9ad8

4 files changed

Lines changed: 38 additions & 2 deletions

File tree

docs/docs/api-reference/enriched-text.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ interface EnrichedTextProps extends ViewProps {
3939
allowFontScaling?: boolean;
4040
onLinkPress?: (event: OnLinkPressEvent) => void;
4141
onMentionPress?: (event: OnMentionPressEvent) => void;
42+
onImagePress?: (event: OnImagePressEvent) => void;
4243
}
4344
```
4445

@@ -209,6 +210,33 @@ interface OnMentionPressEvent {
209210
| -------------------------------------- | ----------------- |
210211
| `(event: OnMentionPressEvent) => void` | Android, iOS, Web |
211212

213+
### `onImagePress` {#onimagepress}
214+
215+
Called when the user presses an inline image. Receives an `OnImagePressEvent`
216+
with the image's URI and dimensions. See
217+
[Inline images](/rich-text-formatting/inline-images) for how images are
218+
inserted and rendered.
219+
220+
```ts
221+
interface OnImagePressEvent {
222+
image: {
223+
uri: string;
224+
width: number;
225+
height: number;
226+
};
227+
}
228+
```
229+
230+
| Type | Platforms |
231+
| ------------------------------------ | ----------------- |
232+
| `(event: OnImagePressEvent) => void` | Android, iOS, Web |
233+
234+
:::note
235+
236+
No visual feedback is applied on press.
237+
238+
:::
239+
212240
## EnrichedTextHtmlStyle type
213241

214242
Extends [`HtmlStyle`](/api-reference/enriched-text-input#htmlstyle-type) with

docs/docs/core-functionalities/handling-input-events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Full payload shapes of the available callbacks can be found in the [`EnrichedTex
1414

1515
This page covers `EnrichedTextInput` events. The read-only
1616
[`EnrichedText`](/core-functionalities/rendering-rich-text) component only
17-
exposes `onLinkPress` and `onMentionPress` callbacks.
17+
exposes `onLinkPress`, `onMentionPress`, and `onImagePress` callbacks.
1818

1919
:::
2020

docs/docs/core-functionalities/rendering-rich-text.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ the only shape difference from the input's `htmlStyle`. See the
5353

5454
- **`selectable`** - allow the user to select and copy the rendered text.
5555
Defaults to `false`.
56-
- **`onLinkPress` / `onMentionPress`** - fire when a link or mention is pressed.
56+
- **`onLinkPress` / `onMentionPress` / `onImagePress`** - fired when a link,
57+
mention, or inline image is pressed.
5758
- **`numberOfLines` / `ellipsizeMode`** - truncate long content to a fixed
5859
number of lines with an ellipsis.
5960
- **`useHtmlNormalizer`** - normalize external or messy HTML into the library's canonical

docs/docs/rich-text-formatting/inline-images.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,10 @@ surfaces those through the [`onPasteImages`](/api-reference/enriched-text-input#
5959
MIME type, and dimensions so you can upload or resize before inserting.
6060

6161
:::
62+
63+
## Handling image presses
64+
65+
When rendering content with [`EnrichedText`](/core-functionalities/rendering-rich-text),
66+
use [**`onImagePress`**](/api-reference/enriched-text#onimagepress) to react when
67+
the user taps an inline image. The callback receives the image's URI and
68+
dimensions. No visual feedback is applied on press.

0 commit comments

Comments
 (0)