Skip to content

Commit

Permalink
Add TextInput windows-specific properties to documentation (#927)
Browse files Browse the repository at this point in the history
## Description
Adds TextInput into components so we can document windows-specific
properties.

### Why
There is currently no documentation for these properties even though
they get used quite often. This adds a section to the components so it's
easily discoverable. But let me know if there's a better place for these
properties!

Resolves #916

## Screenshots

![image](https://github.com/microsoft/react-native-windows-samples/assets/42554868/7067c78a-e3db-480c-882e-bdcc1c28c683)

###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/microsoft/react-native-windows-samples/pull/927)

---------

Co-authored-by: Chris Glein <26607885+chrisglein@users.noreply.github.com>
  • Loading branch information
TatianaKapos and chrisglein authored Mar 1, 2024
1 parent 07fe224 commit 5f22fe7
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .spelling
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ i.e.
initializer
interop
iOS
KeyEvents
ItemGroup
lifecycle
macOS
middleware
monorepos
MSBuild
MSBuild.exe
multiline
namespace
namespaces
native-ized
Expand Down Expand Up @@ -73,11 +75,13 @@ roadmap
runtime
runtimes
schemas
shiftKey
Sourcetree
struct
symlink
symlinks
tada
TextInput
theming
toolchain
TurboModule
Expand Down
32 changes: 32 additions & 0 deletions docs/textinput-component-windows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
id: textinput-component
title: TextInput
---

# Reference

## Props

Inherits [TextInput Props](https://reactnative.dev/docs/textinput).

## Windows-Specific Properties

### `submitKeyEvent`

A property that registers a set of KeyEvents that may trigger `onSubmitEditing` in a multiline scenario.

| type | required |
|:--|:--|
| { code: 'Enter', shiftKey: bool } | No |

### `clearTextOnSubmit`

If `true`, the text field will clear when submitted. The default value is false.

| type | required |
|:--|:--|
| bool | No |

## Examples

Examples can be found in the [React Native Gallery App](https://github.com/microsoft/react-native-gallery/blob/main/src/examples/TextInputExamplePage.tsx) available in the [Microsoft Store](http://aka.ms/reactnativegalleryapp)
3 changes: 2 additions & 1 deletion website/sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@
"Components (Windows)": [
"flyout-component",
"glyph-component",
"popup-component"
"popup-component",
"textinput-component"
],
"JavaScript API (Windows)": [
"apptheme-api",
Expand Down

0 comments on commit 5f22fe7

Please sign in to comment.