Tony Du
1e3cb91707
Allow multiline TextInputs be submittable without blurring ( #33653 )
...
Summary:
For multiline TextInputs, it's possible to send the submit event when pressing the return key only with `blurOnSubmit`. However, there's currently no way to do so without blurring the input and dismissing the keyboard. This problem is apparent when we want to use a TextInput to span multiple lines but still have it be submittable (but not blurrable), like one might want for a TODO list.

## Changelog
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->
[General] [Added] - Add `returnKeyAction` prop to `TextInput` component
[General] [Deprecated] - Remove usages of `blurOnSubmit` in native code and convert `blurOnSubmit` to `returnKeyAction` in the JavaScript conversion layer
Pull Request resolved: https://github.com/facebook/react-native/pull/33653
Test Plan:
Verified old usages of combinations of `blurOnSubmit` and `multiline` matched previous behavior and that the new `returnKeyAction` prop behaves as expected.
| Android | iOS |
| --- | -- |
|  |  |
With the changes, the TODO list example from before now looks like this:

Reviewed By: yungsters
Differential Revision: D35735249
Pulled By: makovkastar
fbshipit-source-id: 1f2237a2a5e11dd141165d7568c91c9824bd6f25
2022-07-22 13:08:45 -07:00
Samuel Susla
8c6a98400e
Introduce TextInput.onChangeSync
...
Summary:
changelog: [internal]
Add experimental `TextInput.onChangeSync` which delivers onChange event synchronously.
Reviewed By: ShikaSD
Differential Revision: D33188083
fbshipit-source-id: 1e1dcd0d71c7eec98d3d5f69967659e07ac4e6a6
2021-12-30 06:38:50 -08:00
Nadiia D
9be3356e02
replace defaultProps usage in functional components
...
Summary:
Changelog:
[General] [Removed] - Replace defaultProps usage in functional components
Reviewed By: kacieb
Differential Revision: D24907836
fbshipit-source-id: 05c7381b66c7738790eff5fea594791c3ecfa12e
2020-11-13 17:07:11 -08:00
Tim Yung
a1ac2518a3
TextInput: Default blurOnSubmit in JS
...
Summary:
Consolidates the logic for the default value of `blurOnSubmit` on `TextInput` in the JavaScript component.
This only materially impacts Fabric.
Changelog:
[Internal]
Reviewed By: mdvacca
Differential Revision: D21491482
fbshipit-source-id: 16d8aba32e7d0321a4583e87e03405ea587e35d4
2020-05-09 17:24:19 -07:00
Samuel Susla
00c4d950cf
Implement event count for TextInput
...
Summary:
Changelog: [Internal]
Implementation of event count for Fabric's Text input.
Reviewed By: JoshuaGross
Differential Revision: D20800185
fbshipit-source-id: 988692cb2fc786649821cccb06e629b40b9b0479
2020-04-09 03:44:55 -07:00
Eli White
e483bd4d49
Add Jest snapshot tests to TextInput
...
Summary:
$title
Changelog: [Internal]
Reviewed By: yungsters
Differential Revision: D18536359
fbshipit-source-id: 382c81c094c0ae28ec3e203cb0726bdbccf755dc
2019-11-20 18:09:30 -08:00
Brandon Carroll
de12b98cd5
WIP: add snapshots for mocked and unmocked components ( #24554 )
...
Summary:
Per a conversation with TheSavior, in #24538 , this adds snapshot tests for all components whose mocks will be addressed in that PR. Shallow and deep snapshots are included.
[General] [Added] - Snapshots
Pull Request resolved: https://github.com/facebook/react-native/pull/24554
Differential Revision: D15062197
Pulled By: cpojer
fbshipit-source-id: 70ddbaa5e6d1d2c0fd1130ab04c458d9c49d0ee8
2019-04-24 06:52:20 -07:00