From 5f22fe79b90604827eaa288823ab61520cedac92 Mon Sep 17 00:00:00 2001 From: Tatiana Kapos Date: Fri, 1 Mar 2024 11:42:26 -0800 Subject: [PATCH] Add TextInput windows-specific properties to documentation (#927) ## 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> --- .spelling | 4 ++++ docs/textinput-component-windows.md | 32 +++++++++++++++++++++++++++++ website/sidebars.json | 3 ++- 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 docs/textinput-component-windows.md diff --git a/.spelling b/.spelling index fa89061be..31ae39caf 100644 --- a/.spelling +++ b/.spelling @@ -38,6 +38,7 @@ i.e. initializer interop iOS +KeyEvents ItemGroup lifecycle macOS @@ -45,6 +46,7 @@ middleware monorepos MSBuild MSBuild.exe +multiline namespace namespaces native-ized @@ -73,11 +75,13 @@ roadmap runtime runtimes schemas +shiftKey Sourcetree struct symlink symlinks tada +TextInput theming toolchain TurboModule diff --git a/docs/textinput-component-windows.md b/docs/textinput-component-windows.md new file mode 100644 index 000000000..c40d6768c --- /dev/null +++ b/docs/textinput-component-windows.md @@ -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) diff --git a/website/sidebars.json b/website/sidebars.json index 3f7d619fc..5f3ee7e63 100644 --- a/website/sidebars.json +++ b/website/sidebars.json @@ -53,7 +53,8 @@ "Components (Windows)": [ "flyout-component", "glyph-component", - "popup-component" + "popup-component", + "textinput-component" ], "JavaScript API (Windows)": [ "apptheme-api",