Janic Duplessis and Mike Grabowski
634c366984
Fix currentlyFocusedField by Removing this usage in TextInputState ( #19834 )
...
Summary:
I broke `currentlyFocusedField` when adding it back in ce3b7b8204 because `this` no longer refers to the proper object because it is assigned here https://github.com/facebook/react-native/commit/ce3b7b8204dad0fd62a76a0ce66472eca4b25bc8#diff-b48972356bc8dca4a00747d002fc3dd5R330 . This code was pretty prone to breaking so I simply removed the `this` usage and rely on a top level variable instead. Also moved everything to named functions.
Pull Request resolved: https://github.com/facebook/react-native/pull/19834
Differential Revision: D8943088
Pulled By: hramos
fbshipit-source-id: 24d1470f6117138a5978fb7e467147847a9f3658
2018-09-10 11:49:40 +02:00
Jens Panneel and Mike Grabowski
5b7a817723
Feature/add decimal pad to android ( #19714 )
...
Summary:
For a current use-case we need the a keyboard with characters 0-9 and a decimal point (or comma depending on language settings)
This exists on iOS as UIKeyboardType "decimalPad" and this is what react-native maps to for both "numeric" and "decimal-pad". This also exists on Android as inputType "numberDecimal", but is currently not accessible through react-native.
This PR maps the value "decimal-pad" of the keyboardType property of TextInput to the Android inputType "numberDecimal", effectively making "decimal-pad" cross platform without breaking anything.
* https://facebook.github.io/react-native/docs/textinput.html#keyboardtype
* https://developer.apple.com/documentation/uikit/uikeyboardtype
* https://developer.android.com/reference/android/widget/TextView#attr_android:inputType
There is this bug in some Samsung keyboards where both the - sign and decimal sign disappear when the keyboardType is set to "number" and both the "signed" and "decimal" flags are set. (Like is the case when using the react-native keyboardType prop "numeric".) https://androidforums.com/threads/numeric-soft-keyboard-missing-minus-sign-in-android-8-0-samsung-a5.1272628/
For developers that need decimal numbers but not negative ones, using "decimal-pad" will provide a workaround. I reproduced this on a Samsung A5 only, but maybe other phones have this exact issue. https://github.com/facebook/react-native/issues/12988 https://github.com/facebook/react-native/issues/12977 https://github.com/facebook/react-native/issues/17473 https://github.com/facebook/react-native/issues/17474
* Added testcase consistent with existing keyboardType tests
* Also added testcase for the related, but missing number-pad
This PR follows the same approach as the recently merged PR introducing "number-pad" https://github.com/facebook/react-native/pull/18350/commits/b638847a46491bd75e7ce7928c73f7cb78399195
Documentation PR: https://github.com/facebook/react-native-website/pull/405
[ANDROID] [ENHANCEMENT] [TextInput] - Added "decimal-pad" keyboard type
Closes https://github.com/facebook/react-native/pull/19714
Differential Revision: D8429185
Pulled By: mdvacca
fbshipit-source-id: 6b56da2088f2be427ebffa04c4e17c91ffb9f7d9
2018-06-27 18:25:24 +02:00
Eli White and Facebook Github Bot
a51e8b19cc
Don't pass additional args to requireNativeComponent in .android.js files
...
Reviewed By: sahrens
Differential Revision: D8345921
fbshipit-source-id: 187048ad4c1b361f0b99b993052bdcaf47a266db
2018-06-10 15:38:32 -07:00
Eli White and Facebook Github Bot
f50ce0850d
Passing forwardedRef to Slider
...
Reviewed By: sahrens
Differential Revision: D8345883
fbshipit-source-id: d2affdba14d38593541e591fe72006c76fca166f
2018-06-10 14:28:37 -07:00
Eli White and Facebook Github Bot
160bf731e5
Switch to Platform.isTV to pass Android Flow
...
Reviewed By: sahrens
Differential Revision: D8345911
fbshipit-source-id: 9af7a25127e7c35844a6c59b267a77cf8adba535
2018-06-10 13:45:57 -07:00
Eli White and Facebook Github Bot
ad67f556fb
Migrate PickerIOS to ES6 Class
...
Reviewed By: sahrens
Differential Revision: D8343380
fbshipit-source-id: 9432f0810c67034f20b44ba9f4955d4ffd2ef1d2
2018-06-09 18:16:22 -07:00
Peter van der Zee and Facebook Github Bot
29fb2a8e90
Bump Prettier to 1.13.4 on xplat
...
Summary:
Bump Prettier to use version 1.13.4
All code changes are caused by running Prettier and should only affect files that have an `format` header.
All other changes caused by yarn.
Reviewed By: ryanmce
Differential Revision: D8251255
fbshipit-source-id: 0b4445c35f1269d72730f2000002a27c1bc35914
2018-06-06 05:32:06 -07:00
Eli White and Facebook Github Bot
970caa4552
Switch to ES6 Class
...
Reviewed By: yungsters
Differential Revision: D8246980
fbshipit-source-id: fbd6998429e6791000ea093d3fa15c1a486914bd
2018-06-02 22:43:21 -07:00
Eli White and Facebook Github Bot
5259450c14
Slider to ES6 Class
...
Reviewed By: yungsters
Differential Revision: D8246422
fbshipit-source-id: 1955ae87abe077115ac8f8ea105be85db8ea66b4
2018-06-02 22:43:19 -07:00
Eli White and Facebook Github Bot
615daeb68f
Slider move prop comments to flow types
...
Reviewed By: yungsters
Differential Revision: D8246378
fbshipit-source-id: f62a77d64016f6502b3445ab6d0d1558034333e6
2018-06-02 22:43:18 -07:00
Eli White and Facebook Github Bot
1615f9d161
Slider remove $FlowFixMe #take2
...
Reviewed By: fkgozali
Differential Revision: D8246336
fbshipit-source-id: 21555a318bd823309ac2c285b49c2045338c2b28
2018-06-01 22:07:46 -07:00
Eli White and Facebook Github Bot
7498e5ce77
Revert D8234803: [RN] Slider remove $FlowFixMe
...
Differential Revision:
D8234803
Original commit changeset: cfc0466a54f3
fbshipit-source-id: 354fcc1853597cbcd518abaf4be5b11116f594b3
2018-06-01 20:17:58 -07:00
Eli White and Facebook Github Bot
e0db8ee645
Slider remove $FlowFixMe
...
Reviewed By: sahrens
Differential Revision: D8234803
fbshipit-source-id: cfc0466a54f3c219d8a2eadfebf840399a2abdd8
2018-06-01 17:54:50 -07:00
Tim Yung and Facebook Github Bot
8dc3ba0444
RN: Remove Native Prop Validation
...
Summary:
As we migrate over to static typing solutions for props, we cannot rely on always having `propTypes` available at runtime.
This gets us started on that journey by removing the native prop validation that happens when we require native components.
bypass-lint
Reviewed By: TheSavior
Differential Revision: D7976854
fbshipit-source-id: f3ab579a7f0f8cfb716b0eb7fd4625f8168f3d96
2018-06-01 12:54:14 -07:00
Eli White and Facebook Github Bot
f8c8231706
DatePickerIOS ES6 Class
...
Reviewed By: sahrens
Differential Revision: D8219657
fbshipit-source-id: cef48cf3ad24ad442f07df0edad55ab97d96c6f2
2018-06-01 10:25:30 -07:00
Eli White and Facebook Github Bot
3b53091869
DatePickerIOS add onChange event definition
...
Reviewed By: sahrens
Differential Revision: D8219622
fbshipit-source-id: 37f26d0981318b7eab9d3c734c44e7714fa6f0e8
2018-06-01 10:25:30 -07:00
Eli White and Facebook Github Bot
edd7acbb1e
ActivityIndicator ES6 Class
...
Reviewed By: yungsters
Differential Revision: D8219463
fbshipit-source-id: 7d252d15bb4a7345d156b1659b09be2a4a69ba6c
2018-06-01 10:25:30 -07:00
Eli White and Facebook Github Bot
a35a238317
RefreshControl ES6 Class
...
Reviewed By: sahrens
Differential Revision: D8219221
fbshipit-source-id: 445243964d64dd5274c1e47bdc137645dc8eecaf
2018-06-01 10:25:30 -07:00
Héctor Ramos and Facebook Github Bot
95554add98
Update Jest snapshots
...
Summary:
Jest will now exclude undefined props from snapshots (https://github.com/facebook/jest/pull/6162 ). Updating the snapshots should fix the current `test_javascript` failures.
Circle CI
[INTERNAL][MINOR][Snapshots] - Update snapshots
Closes https://github.com/facebook/react-native/pull/19414
Differential Revision: D8125193
Pulled By: hramos
fbshipit-source-id: db8dcfcd8afbf9d6256f83c6e922680a7872d776
2018-05-29 17:30:16 -07:00
Chirag Shah and Facebook Github Bot
84c965f085
Typo fixes
...
Summary:
Spotted a few typos while going through the source code
No tests are required
[INTERNAL] [MINOR] [Webview] - Fixed typos
Closes https://github.com/facebook/react-native/pull/19462
Differential Revision: D8176774
Pulled By: hramos
fbshipit-source-id: f1a9024b210e1a935dcdccd7e27daedb71d794bc
2018-05-26 21:01:37 -07:00
Janic Duplessis and Facebook Github Bot
ce3b7b8204
Bring back TextInput.State, deprecate focusTextInput and blurTextInput
...
Summary:
a275eac56e removed TextInput.State but we should keep it as it was a public-ish API and we don't have any migration plan off it. Also bring back `focusTextInput` and `blurTextInput` with a deprecation warning.
Tested TextInput.State is back
[GENERAL][ENHANCEMENT][TextInput] - Bring back TextInput.State, deprecate focusTextInput and blurTextInput
Closes https://github.com/facebook/react-native/pull/18936
Differential Revision: D8044439
Pulled By: hramos
fbshipit-source-id: fde145f04bb1d46ef58b5954cb7963adf495b21c
2018-05-17 11:26:22 -07:00
Janic Duplessis and Facebook Github Bot
ffe6c110f7
Fix keyboard handling with keyboardShouldPersistTaps: never
...
Summary:
When `keyboardShouldPersistTaps` is `"never"` it would break when doing the following steps:
- Tap input 1, keyboard goes up
- Tap input 2, keyboard stays down (The bug I expected without the isTextInput check was that it would dismiss instead :o )
- Tap outside, keyboard stays down. It should dismiss here since it should never persist taps (unless tapping another input)
What seems to happen is that RN `currentlyFocusedTextInput` goes out of sync with the focused text input and is null even if there is still a text input focused. I haven't had time to investigate the cause of that (probably some race condition because of trying to focus and blur at the same time) but we should not try to dismiss the keyboard when tapping another TextInput in the first place.
I reproduced the bug mentioned by setting `keyboardShouldPersistTaps` to `"never"` in RNTesterPage.js and then using the steps described above. I made sure that the bug did not happen after this change.
[GENERAL][BUGFIX][ScrollResponder] - Fix keyboard handling with keyboardShouldPersistTaps: never
Closes https://github.com/facebook/react-native/pull/19255
Differential Revision: D8002818
Pulled By: mdvacca
fbshipit-source-id: 6ecb8d2c30eb9338529471a958b5dc04037c7ec6
2018-05-14 23:46:50 -07:00
Tim Yung and Facebook Github Bot
c017dcb0f2
RN: Switch KeyboardAvoidingView to Class Syntax
...
Summary:
Refactors `KeyboardAvoidingView` by using class syntax and fixing all Flow errors.
Note that there's still a bunch of sketchy stuff going on in this component with mutated instance variables (that are used in `render`!) and unsafe lifecycle methods. But at least now it's a little bit less painful on the eyes.
Reviewed By: TheSavior
Differential Revision: D7987443
fbshipit-source-id: f5c27a9dd383c430d9a5a9dc0b6e10e2c4fe8dd9
2018-05-14 17:52:25 -07:00
Eli White and Facebook Github Bot
113f009698
Flowtype SegmentedControlIOS
...
Reviewed By: yungsters
Differential Revision: D7985978
fbshipit-source-id: 6579ad8dd5c5377571fd790149ea5cfc6b33939f
2018-05-14 00:24:44 -07:00
Eli White and Facebook Github Bot
c87701ba05
Flowtype ProgressViewIOS
...
Reviewed By: yungsters
Differential Revision: D7985969
fbshipit-source-id: d351ebc26e7be2741c93ce462ae59aa13d0c1f27
2018-05-14 00:24:44 -07:00
Eli White and Facebook Github Bot
1c66cdc7e8
Flowtype PickerIOS
...
Reviewed By: yungsters
Differential Revision: D7985960
fbshipit-source-id: 9fbce5fafe47bee1d2a527c72f3ebef85d26f9f1
2018-05-14 00:24:44 -07:00
Eli White and Facebook Github Bot
d796129895
Delete LazyRenderer
...
Summary: This isn't used internally at Facebook and we have no public documentation for this component. If people are interested in using it they can easily reproduce this function outside of core.
Reviewed By: yungsters
Differential Revision: D7985955
fbshipit-source-id: 859878a858cbcb42fec7f9bd04e5d7574801e445
2018-05-14 00:24:44 -07:00
Eli White and Facebook Github Bot
06052a2330
Flowtype Switch
...
Reviewed By: yungsters
Differential Revision: D7985880
fbshipit-source-id: eaaff2188b8257d09e1bf628d19dae6dfb4c2fc6
2018-05-14 00:24:44 -07:00
Eli White and Facebook Github Bot
cbe045a95f
Flowtype Slider
...
Reviewed By: yungsters
Differential Revision: D7985857
fbshipit-source-id: 8b6b9f58aa89b898fa38d1cfc0564df5f64741a2
2018-05-14 00:24:44 -07:00
Eli White and Facebook Github Bot
891dfc3da4
Flowtype RefreshControl
...
Reviewed By: yungsters
Differential Revision: D7985835
fbshipit-source-id: 67a27cb99738d99959b1c795af95d0415a84f1b9
2018-05-14 00:24:44 -07:00
Eli White and Facebook Github Bot
4b1ecb6204
Flowtype ListView
...
Reviewed By: yungsters
Differential Revision: D7985836
fbshipit-source-id: 6e0944a8d2fb85aabc34dfd3125a07b208749f21
2018-05-14 00:24:44 -07:00
Eli White and Facebook Github Bot
af6e2eb02d
Removing unnecessary FlowFixMe
...
Reviewed By: yungsters
Differential Revision: D7985749
fbshipit-source-id: ba7e152749c5a5cac134b51e0229dc11870bb3e0
2018-05-14 00:24:44 -07:00
Eli White and Facebook Github Bot
1419c7a7fd
Migrate ScrollView fake type to ReactNative.NativeComponent
...
Reviewed By: yungsters
Differential Revision: D7985122
fbshipit-source-id: b78fc6ad84485e8aa42657c2b21d70c9f3a271d6
2018-05-14 00:24:44 -07:00
Eli White and Facebook Github Bot
ffda017850
Removing unnecessary FlowFixMe
...
Reviewed By: yungsters
Differential Revision: D7985116
fbshipit-source-id: 97a7a37b2ffe7a81669973f9dca6824a4f352a07
2018-05-14 00:24:44 -07:00
Eli White and Facebook Github Bot
c8bcda8150
FlowType TextInput
...
Reviewed By: yungsters
Differential Revision: D7985109
fbshipit-source-id: 294919bce64b21cab4f37262a7da9e68cb67207f
2018-05-14 00:24:44 -07:00
Eli White and Facebook Github Bot
0e707ff843
Clean up TextInput
...
Reviewed By: yungsters
Differential Revision: D7984843
fbshipit-source-id: 17259ade77f08d37dff9bb85984798f99885ad86
2018-05-13 02:01:05 -07:00
Eli White and Facebook Github Bot
8454a36b0b
Flow type TouchableBounce
...
Reviewed By: yungsters
Differential Revision: D7984827
fbshipit-source-id: b0dd67b5c4d57cd9bb0339a5266a16e4565b2d54
2018-05-13 02:01:05 -07:00
Tim Yung and Facebook Github Bot
752863629d
RN: Fix Type for ReactNative.NativeComponent (2/2)
...
Reviewed By: TheSavior
Differential Revision: D7984936
fbshipit-source-id: d0477c54420b49220e9529fa70c2b2babce0b409
2018-05-13 01:05:57 -07:00
Tim Yung and Facebook Github Bot
de11ba2a5e
RN: Fix Type for ReactNative.NativeComponent (1/2)
...
Reviewed By: TheSavior
Differential Revision: D7984814
fbshipit-source-id: 0097819128b7f82267bceeb9d5e1b5057c5129ec
2018-05-13 01:05:56 -07:00
Tim Yung and Facebook Github Bot
41a940392c
RN: Add Missing Events to ViewPropTypes
...
Reviewed By: TheSavior
Differential Revision: D7984937
fbshipit-source-id: fc2703e3382a7515b71f8a634aca5b6d7a5b25b4
2018-05-13 01:05:56 -07:00
Eli White and Facebook Github Bot
44743c07ad
Flow Type TouchableOpacity
...
Reviewed By: yungsters
Differential Revision: D7983709
fbshipit-source-id: 0f664c831b754277e344aa53b2dbed6b4f720cd5
2018-05-12 23:25:09 -07:00
Eli White and Facebook Github Bot
6cfa4a360d
TouchableOpacity @noflow -> @flow
...
Reviewed By: yungsters
Differential Revision: D7983644
fbshipit-source-id: bf4a0ba600ac51ef07ac12927eed29eeb92ffb2a
2018-05-12 23:25:09 -07:00
Eli White and Facebook Github Bot
f0c18dc820
Flow type TouchableHighlight
...
Reviewed By: yungsters
Differential Revision: D7983631
fbshipit-source-id: 98b3708b26e2bf96426d5acaa5c7e2311a3a34f6
2018-05-12 23:25:09 -07:00
Eli White and Facebook Github Bot
6b3aad31f6
Remove unused suppressions
...
Reviewed By: yungsters
Differential Revision: D7983271
fbshipit-source-id: ee64e2dacbc8a1b75915b825f7bf0621a121422d
2018-05-12 23:25:08 -07:00
Eli White and Facebook Github Bot
0b79d1faa2
Type TouchableWithoutFeedback
...
Reviewed By: yungsters
Differential Revision: D7982348
fbshipit-source-id: 409ce4a5ea8c09e58c42caf9db60117253503c4c
2018-05-12 23:25:08 -07:00
Eli White and Facebook Github Bot
91c4b0357a
Remove unused suppressions
...
Reviewed By: yungsters
Differential Revision: D7982027
fbshipit-source-id: 00e538dc678275495e097d9cd14a0a2643ebaefd
2018-05-12 10:35:27 -07:00
Eli White and Facebook Github Bot
b127662279
Flow Type ScrollView
...
Reviewed By: yungsters
Differential Revision: D7981073
fbshipit-source-id: 38c100f37e46683da1e34b335d476e706baae238
2018-05-12 10:35:27 -07:00
Eli White and Facebook Github Bot
188b118b60
Flow Type KeyboardAvoidingView
...
Reviewed By: yungsters
Differential Revision: D7978494
fbshipit-source-id: e21b4910470d3dc3fd35027f2f975b6842baa6ab
2018-05-12 10:35:27 -07:00
Eli White and Facebook Github Bot
97e572ea6d
Flow Type DatePickerIOS.ios.js
...
Reviewed By: yungsters
Differential Revision: D7978090
fbshipit-source-id: 65da360f34f4b6d9240a8343c89be66404767474
2018-05-12 10:35:27 -07:00
Eli White and Facebook Github Bot
0b71d1ddb0
Flow Typing ActivityIndicator
...
Reviewed By: yungsters
Differential Revision: D7977834
fbshipit-source-id: 62e54f98ee8f9e7d5189fc19c803a95f5c4c43aa
2018-05-12 10:35:27 -07:00