Skip to content

Commit a8749db

Browse files
committed
Document search bar ref
1 parent 601474f commit a8749db

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

versioned_docs/version-6.x/native-stack-navigator.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,17 @@ React.useLayoutEffect(() => {
259259
}, [navigation]);
260260
```
261261

262-
Supported properties are described below.
262+
Supported properties are:
263+
264+
##### `ref`
265+
266+
Ref to manipulate the search input imperatively. It contains the following methods:
267+
268+
- `focus` - focuses the search bar
269+
- `blur` - removes focus from the search bar
270+
- `setText` - sets the search bar's content to given value
271+
- `clearText` - removes any text present in the search bar input field
272+
- `cancelSearch` - cancel the search and close the search bar
263273

264274
##### `autoCapitalize`
265275

versioned_docs/version-7.x/elements.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,12 @@ Options for the search bar in the header. When this is specified, the header wil
343343

344344
It can contain the following properties:
345345

346+
- `ref`: Ref to manipulate the search input imperatively. It contains the following methods:
347+
- `focus` - focuses the search bar
348+
- `blur` - removes focus from the search bar
349+
- `setText` - sets the search bar's content to given value
350+
- `clearText` - removes any text present in the search bar input field
351+
- `cancelSearch` - cancel the search and close the search bar
346352
- `autoCapitalize`: The auto-capitalization behavior. Possible values: `none`, `words`, `sentences`, `characters`.
347353
- `autoFocus`: Automatically focus search input on mount.
348354
- `cancelButtonText`: Text to be used instead of default `Cancel` button text (iOS only).

versioned_docs/version-7.x/native-stack-navigator.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,17 @@ React.useLayoutEffect(() => {
493493
}, [navigation]);
494494
```
495495

496-
Supported properties are described below.
496+
Supported properties are:
497+
498+
##### `ref`
499+
500+
Ref to manipulate the search input imperatively. It contains the following methods:
501+
502+
- `focus` - focuses the search bar
503+
- `blur` - removes focus from the search bar
504+
- `setText` - sets the search bar's content to given value
505+
- `clearText` - removes any text present in the search bar input field
506+
- `cancelSearch` - cancel the search and close the search bar
497507

498508
##### `autoCapitalize`
499509

0 commit comments

Comments
 (0)