Andres Suarez
8bd3edec88
Update copyright headers from Facebook to Meta
...
Reviewed By: aaronabramov
Differential Revision: D33367752
fbshipit-source-id: 4ce94d184485e5ee0a62cf67ad2d3ba16e285c8f
2021-12-30 15:11:21 -08:00
Liron Yahdav
771ca921b5
Add TextInput.setSelection method
...
Summary:
Adds a `setSelection` imperative method to `TextInput`.
Changelog:
[General][Added] - Adds a setSelection imperative method to TextInput
Reviewed By: JoshuaGross
Differential Revision: D32186514
fbshipit-source-id: 549a7d93b1c55363cf01d804b1e3d735e55c4481
2021-12-03 11:54:01 -08:00
Tim Yung
148c98ec80
RN: Resolve Outstanding ESLint Warnings
...
Summary:
Resolves outstanding ESLint warnings in React Native.
Changelog:
[Internal]
Reviewed By: lunaleaps
Differential Revision: D32291912
fbshipit-source-id: 61337d5a5a0e6ed55f732675e029f4b76d850af9
2021-11-09 21:46:21 -08:00
Tim Yung
77ecc7ede1
JS: Format with Prettier v2.4.1 [3/n]
...
Summary:
Changelog:
[General][Internal]
Reviewed By: zertosh
Differential Revision: D31883447
fbshipit-source-id: cbbf85e4bf935096d242336f41bf0cc5d6f92359
2021-11-02 22:14:16 -07:00
Tim Yung
70dcba9994
JS: Remove Unused Flow Suppressions
...
Summary:
Cleans up all unused Flow suppressions.
Changelog:
[Internal]
Reviewed By: kacieb
Differential Revision: D31754978
fbshipit-source-id: 951e28a245782b9bc9e93a6417d88b19ba0c8f1c
2021-10-21 14:26:00 -07:00
fabriziobertoglio1987
254493e1fb
Fix - TextInput Drawable to avoid Null Pointer Exception RuntimeError #17530 ( #29452 )
...
Summary:
This issue fixes https://github.com/facebook/react-native/issues/17530 fixes https://github.com/expo/expo/issues/9905 with the help of sunnylqm https://github.com/sunnylqm
Re-rendering a large number of TextInputs with key prop on the screen will trigger the below Null Pointer Exception Runtime Error
NullPointerException:tempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)'
The error is caused by null.newDrawable(mSourceRes) at
https://github.com/aosp-mirror/platform_frameworks_base/blob/20b012282e0c3d94b5c0aa799cdda065f2df06db/graphics/java/android/graphics/drawable/DrawableContainer.java#L919
More info https://github.com/facebook/react-native/pull/29452#issuecomment-662616018 https://github.com/facebook/react-native/issues/17530#issuecomment-662000718
The Theme Theme.AppCompat.Light.NoActionBar defines the Drawables for AppCompatEditText in drawable/abc_edit_text_material.xml
https://chromium.googlesource.com/android_tools/+/7200281446186c7192cb02f54dc2b38e02d705e5/sdk/extras/android/support/v7/appcompat/res/drawable/abc_edit_text_material.xml
Removing the following line from the above xml file drawable/abc_edit_text_material.xml fixes the error https://github.com/facebook/react-native/issues/17530#issuecomment-662000718
`<item android:state_pressed="false" android:state_focused="false" android:drawable="drawable/abc_textfield_default_mtrl_alpha"/>`
The Theme default EditText background is replaced with a custom background, which is a copy of the original background without the above item which triggers the Runtime Error. The changes are implemented in RNTester with commit (more info in the commit) https://github.com/facebook/react-native/commit/0858d4120df242196570f5394f8ae4e623533493 . The new custom drawable used as default background for the TextInput is named edit_text.
`<item name="android:editTextBackground">drawable/edit_text</item>`
The same changes have been added to react-native default template for creating new applications with commit (more info) https://github.com/facebook/react-native/commit/f3493083df5e1b157bbdaf18f97c59b7b0ad828c , lean core moved the cli tools to https://github.com/react-native-community/cli , but the default template for creating a new application is stored in facebook/react-native/template.
New applications will be generated with this configurations and will not experience the error, existing react-native applications will fix the error by upgrading with the [upgrade-helper](https://github.com/react-native-community/upgrade-helper ).
A Minimum Reproducible Example to reproduce this error is included in commit (more info in the commit) https://github.com/fabriziobertoglio1987/react-native/commit/4a414e2cc7e17068da26ef7727a04d0aa5883a17 and https://github.com/facebook/react-native/issues/17530#issuecomment-660017858
## 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
-->
[Android] [Fixed] - TextInput Drawable to avoid Null Pointer Exception RuntimeError https://github.com/facebook/react-native/issues/17530
Pull Request resolved: https://github.com/facebook/react-native/pull/29452
Test Plan:
Works in all scenarios on Android.
**<details><summary>CLICK TO OPEN TESTS RESULTS - React Native</summary>**
<p>
Test Results from the Testing in RNTester.
Minimum Reproducible Example added with commit (more info in the commit) https://github.com/fabriziobertoglio1987/react-native/commit/4a414e2cc7e17068da26ef7727a04d0aa5883a17
The example included in commit https://github.com/fabriziobertoglio1987/react-native/commit/4a414e2cc7e17068da26ef7727a04d0aa5883a17 will cause a [NPE Runtime Error on Master Branch](https://fabriziobertoglio.s3.eu-central-1.amazonaws.com/opensource/react-native/17530/runtime.mp4 ), while no error is experienced in the [feature branch](https://fabriziobertoglio.s3.eu-central-1.amazonaws.com/opensource/react-native/17530/no_runtime.mp4 ). The links are video hosted on s3 of this tests (playable by google chrome).
| **[BEFORE](https://fabriziobertoglio.s3.eu-central-1.amazonaws.com/opensource/react-native/17530/runtime.mp4 )** | **[AFTER](https://fabriziobertoglio.s3.eu-central-1.amazonaws.com/opensource/react-native/17530/no_runtime.mp4 )** |
|:-------------------------:|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/88069187-6edde400-cb71-11ea-81f2-1846144cc6c1.png " width="300" height="" />| <img src="https://user-images.githubusercontent.com/24992535/88069503-d5630200-cb71-11ea-9b87-c5c49845c96d.png " width="300" height="" /> |
The below screenshots were taken to detect any issues with the EditText Background. There is no difference between master and feature branch.
| **BEFORE** | **AFTER** |
|:-------------------------:|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/88071948-c0d43900-cb74-11ea-9a86-522b13e79f04.png " width="300" height="" />| <img src="https://user-images.githubusercontent.com/24992535/88074345-90da6500-cb77-11ea-8ced-8b34a3c5a299.png " width="300" height="" /> |
| **BEFORE** | **AFTER** |
|:-------------------------:|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/88071966-c598ed00-cb74-11ea-8db8-c07dce3a99b6.png " width="300" height="" />| <img src="https://user-images.githubusercontent.com/24992535/88074654-fcbccd80-cb77-11ea-961c-f39a60a1aa62.png " width="300" height="" /> |
| **BEFORE** | **AFTER** |
|:-------------------------:|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/88071989-cc276480-cb74-11ea-9eab-9ad4f858d0fb.png " width="300" height="" />| <img src="https://user-images.githubusercontent.com/24992535/88074673-00505480-cb78-11ea-8ff5-ea5fc9ef1b8e.png " width="300" height="" /> |
| **BEFORE** | **AFTER** |
|:-------------------------:|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/88072003-d0ec1880-cb74-11ea-9285-792b2dc08187.png " width="300" height="" />| <img src="https://user-images.githubusercontent.com/24992535/88074685-03e3db80-cb78-11ea-86a5-da2700826eea.png " width="300" height="" /> |
| **BEFORE** | **AFTER** |
|:-------------------------:|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/88072080-e7926f80-cb74-11ea-9f08-bb26eabbd5a0.png " width="300" height="" />| <img src="https://user-images.githubusercontent.com/24992535/88074866-4a393a80-cb78-11ea-9b37-80c019909d7d.png " width="300" height="" /> |
| **BEFORE** | **AFTER** |
|:-------------------------:|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/88072100-ed885080-cb74-11ea-8450-bafa2b7a9989.png " width="300" height="" />| <img src="https://user-images.githubusercontent.com/24992535/88074976-7359cb00-cb78-11ea-8bf3-d50566cbb3ba.png " width="300" height="" /> |
| **BEFORE** | **AFTER** |
|:-------------------------:|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/88072113-f1b46e00-cb74-11ea-9143-7e74872f2670.png " width="300" height="" />| <img src="https://user-images.githubusercontent.com/24992535/88074880-502f1b80-cb78-11ea-8bfc-f67efec283d3.png " width="300" height="" /> |
| **BEFORE** | **AFTER** |
|:-------------------------:|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/88072118-f547f500-cb74-11ea-8ba3-8a245fdf0bc3.png " width="300" height="" />| <img src="https://user-images.githubusercontent.com/24992535/88074883-52917580-cb78-11ea-9230-71aeb5c35582.png " width="300" height="" /> |
| **BEFORE** | **AFTER** |
|:-------------------------:|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/88072139-fb3dd600-cb74-11ea-9212-485f788648f1.png " width="300" height="" />| <img src="https://user-images.githubusercontent.com/24992535/88075031-85d40480-cb78-11ea-8068-50f04ebbff54.png " width="300" height="" /> |
| **AFTER** |
|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/88071330-f75d8400-cb73-11ea-800d-359336c8d51e.png " width="300" height="" />|
</p>
</details>
**<details><summary>CLICK TO OPEN TESTS RESULTS - React Native Cli</summary>**
<p>
As lean core move cli tools to https://github.com/react-native-community/cli , I tested the changes to the template in a separate repository https://github.com/fabriziobertoglio1987/react-native-template and generated the template with the following command
```
npx react-native init ProjectName --template file:///home/fabrizio/Documents/sourcecode/opensource/react-native-template/template
```
The generated app did not experience any issues and includes all the changes in [rn_edit_text_material.xml](https://github.com/fabriziobertoglio1987/react-native-template/blob/master/ProjectName/android/app/src/main/res/drawable/rn_edit_text_material.xml ) and [styles.xml](https://github.com/fabriziobertoglio1987/react-native-template/blob/master/ProjectName/android/app/src/main/res/values/styles.xml )
</p>
</details>
Reviewed By: cortinico
Differential Revision: D30684030
Pulled By: lunaleaps
fbshipit-source-id: 7404da0a7259a4bc0405e57e5ed908649d180524
2021-10-01 16:44:02 -07:00
Evan Yeung
afe0c1daea
Remove existential types from xplat/js
...
Summary: Changelog: [Internal]
Reviewed By: pieterv
Differential Revision: D29724915
fbshipit-source-id: 97cbeefbba2ddc2e1088dfe19db14fa545213549
2021-07-21 16:52:22 -07:00
Tim Yung
9d2fedc6e2
RN: Unify Typeface Logic (Android)
...
Summary:
Refactors how `Typeface` style and weight are applied in React Native on Android.
- Unifies all style and weight normalization logic into a new `TypefaceStyle` class.
- Fixes font weight support for the Fabric renderer.
- De-duplicates code with `TextAttributeProps`.
- Simplified normalization logic.
- Fixes a rare crash due to `Typeface.sDefaultTypeface` (Android SDK) being `null`.
- Adds a new example to test font weights in `TextInput`.
- Adds missing `Nullsafe` and `Nullable` annotations.
- Clean up a bunch of obsolete inline comments.
Changelog:
[Android][Fixed] - Fixed a rare crash due to `Typeface.sDefaultTypeface` (Android SDK) being `null`.
[Android][Fixed] - Fixed font weight support for the Fabric renderer.
[Android][Added] - Added a new example to test font weights in `TextInput`.
Reviewed By: JoshuaGross
Differential Revision: D29631134
fbshipit-source-id: 3f227d84253104fa828a5561b77ba7a9cbc030c4
2021-07-12 22:17:12 -07:00
Luna Wei
fa3243ad33
Rename things in RNTester
...
Summary:
Changelog:
[Internal] - Rename some types and components in RNTester to support work for tertiary levels of navigation.
module = component | api
moduleExample = an example of a certain feature a module
Reviewed By: kacieb
Differential Revision: D29381875
fbshipit-source-id: c348bcbb73aaf95e85928bb14080a097e685cc78
2021-07-01 14:35:30 -07:00
Daniel Sainati
74d5d03dbd
pre-suppress Flow errors in xplat ahead of 153 release
...
Summary:
This pre-suppresses the 153 error diff ahead of its release, since it is large.
Changelog: [Internal]
Reviewed By: mroch
Differential Revision: D28754374
fbshipit-source-id: 1806f53bc7d804644d434583a2dcd6da63d00328
2021-06-01 09:01:26 -07:00
Luna Wei
ec2dc9e4f2
Fix TextInput-cursorPlacement test
...
Summary:
Changelog:
[Internal] - In internal e2e testing, json.stringify is unstable and will occasionally re-order keys. Fix so it's consistent across tests
Reviewed By: kacieb
Differential Revision: D28397174
fbshipit-source-id: 0f2db697d245654c88c3dff3d083bc82890d4bc1
2021-05-18 18:19:24 -07:00
Paige Sun
d90253da36
iOS: Fix InputAccessoryView disappearing when inputAccessoryViewID exists
...
Summary:
InputAccessoryView disappears on Fabric (not Paper) when the text prop changes.
Changelog: [Fabric] [iOS] Fix InputAccessoryView disappearing when inputAccessoryViewID exists
Differential Revision: D27721549
fbshipit-source-id: 163dfcf0a8d5226453f4de356650a6ba82bee10b
2021-04-20 12:50:25 -07:00
Hans Halverson
d477f80113
Deploy Flow v0.146.0
...
Summary: Changelog: [Internal]
Reviewed By: mroch
Differential Revision: D26835439
fbshipit-source-id: 2607c3185485c8bd2c7e868dd2e3e0c06866f1f9
2021-03-06 11:37:57 -08:00
Nadiia D
2c19d85285
TextInput: test cursor placement
...
Summary:
Changelog:
[General][Internal] Added some test IDs for the TextIput examples.
Reviewed By: lunaleaps
Differential Revision: D26265361
fbshipit-source-id: 26d7a69f74f283daed2ddabaaf31113cd3089bf3
2021-02-09 21:07:52 -08:00
Nadiia D
05b54cbee9
TextInput: create shared test utils
...
Summary:
Changelog:
[General][Internal] Added some test IDs and names for the TextIput examples.
Reviewed By: lunaleaps
Differential Revision: D26263554
fbshipit-source-id: 958a030eafbbed9076f49ab05585f30ddef3ef23
2021-02-09 21:07:51 -08:00
Nadiia D
f5f69af87f
Change test file names to align with the set convention
...
Summary:
Changelog:
[General][Changed] Change RNTester example name
Reviewed By: lunaleaps
Differential Revision: D26129706
fbshipit-source-id: 53e906f26dd18ef8bceca2e3700e3403e3d0421a
2021-01-29 10:15:42 -08:00
Nadiia D
6661517162
add optional name prop to RNTester example
...
Summary:
Use the name prop to render test cases.
Changelog:
[General][Changed] - Add optional name prop to RNTester examples
Reviewed By: lunaleaps
Differential Revision: D26078614
fbshipit-source-id: 82b13184aefee461c72b49c505f8848dd639eef0
2021-01-27 03:11:26 -08:00
1270873ed6
RNTester UI Redesign ( #29685 )
...
Summary:
This Pull request adds the UI changes to the RNTester app as discussed in the MLH Fellowship.
This list is not exhaustive.
- The initial App screen is redesigned.
- A bottom Navbar has been added.
- Filter pills are added.
- The list card UI is updated.
- The example page UI is updated.
- Recently Viewed Sections are added. It shows the last 5 recently viewed components/APIs.
- Bookmarking functionality is added.
- The documentation URL is added to the example page.
- RNTester doesn't lose its state on a hard refresh (even on iOS).
<img width="373" src="https://user-images.githubusercontent.com/22813027/90530113-20346180-e192-11ea-8ef6-789fa25b402b.png " />
<img width="373" src="https://user-images.githubusercontent.com/22813027/90530112-20346180-e192-11ea-9539-706b540fcc5f.png " />
<img width="373" src="https://user-images.githubusercontent.com/22813027/90530100-1d397100-e192-11ea-8836-b88070643233.png " />
<img width="373" src="https://user-images.githubusercontent.com/22813027/90530110-1f9bcb00-e192-11ea-936b-64ee75fa4289.png " />
Pull Request resolved: https://github.com/facebook/react-native/pull/29685
Test Plan:
Imported from GitHub, without a `Test Plan:` line.
{F302717939}
Note: this failed **before** this diff too:
{F302745716}
Reviewed By: mdvacca, cpojer
Differential Revision: D23240434
fbshipit-source-id: 65e2766a6a097eca0e0d0fda8dadf6871e9276c2
Co-authored-by: agarwalmanya <manya18ag@gmail.com >
Co-authored-by: chirag-singhal <csinghal208@gmail.com >
Co-authored-by: Ansh Godha <ag759@cornell.edu >
Co-authored-by: Yash Kumar Verma <yk.verma2000@gmail.com >
Co-authored-by: Sanskar Jethi <sansyrox@gmail.com >
Co-authored-by: Aniketh Saha <anik220798@gmail.com >
Co-authored-by: Xtremilicious <nilarjundas@outlook.com >
Co-authored-by: Jani Evakallio <jani.evakallio@gmail.com >
2020-08-26 08:45:57 -07:00
stealthanthrax
63992c0b96
Migrating RNTester to Packages Directory ( #29567 )
...
Summary:
## 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
-->
This PR aims to migrate the RNTester App to `packages` directory. But is currently, open to inspect the CI issues and resolve the merge conflicts.
Currently done
- Working on iOS
- Working on Android
- Detox Tests working on iOS
Need to work on
- Errors generated by the CI builds
[General] [Changed] - Migrated the RNTester App to the packages directory.
Pull Request resolved: https://github.com/facebook/react-native/pull/29567
Test Plan: It runs on both ios and android for now and the detox iOS builds are working.
Reviewed By: cpojer
Differential Revision: D23034761
Pulled By: rickhanlonii
fbshipit-source-id: e04bb06e1c7ef15d340206090d1575a871b9e6f5
2020-08-19 17:57:08 -07:00