Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
168 commits
Select commit Hold shift + click to select a range
ba73836
Avoid sharing mutable attributed string across threads in RCTBaseText…
christophpurrer Jul 26, 2022
16bc41e
bump CLI to v9.0.0-alpha.5 (#34275)
kelset Jul 27, 2022
57ae992
Allow VirtualizedListContext to support different component type
NickGerleman Jul 27, 2022
3872212
Add VirtualizedList_EXPERIMENTAL (CellRenderMask Usage)
NickGerleman Jul 27, 2022
8932cfb
(jest/setup) remove removeEventListener from AccessibilityInfo and Li…
Jul 27, 2022
0f857f1
Submit the text on Accessory Done button clicked.
Jul 27, 2022
05d3eae
Refactor: Minor performance improvement of BackHandler.removeEventLis…
vitalii-tb Jul 27, 2022
b5e10f5
Fix hermes executor not available when use_frameworks is enabled (#34…
Kudo Jul 27, 2022
68994f2
Adding grid role to ViewAccessibility to fix flow errors. (#34267)
fabOnReact Jul 27, 2022
a957796
#34214 for main (#34271)
Kudo Jul 27, 2022
a02ae79
Bump dependencies version number
Jul 27, 2022
978e4bf
Ensure equivalent Flow and TypeScript turbo module definition generat…
ZihanChen-MSFT Jul 27, 2022
25f8fe1
Improve OSS systrace (#34252)
janicduplessis Jul 27, 2022
54f5383
Allow injecting looser VirtualizedList
NickGerleman Jul 27, 2022
5a56e99
Guard FlatList getItemCount() against incorrect `data` type
NickGerleman Jul 28, 2022
e41fffc
Gracefully handle negative initialScrollIndex in VirtualizedList_EXPE…
NickGerleman Jul 28, 2022
12fafec
Fix test-manual-e2e on Android/Hermes for New App Template (#34294)
cortinico Jul 28, 2022
13f549b
Migrate needsCustomLayoutForChildren check to the new architecture (#…
grahammendick Jul 28, 2022
af45538
Implement GlobalLexicalScopeNamesRequest
mattbfb Jul 28, 2022
b16e403
Allow empty cell ranges in CellRenderMask.addCells()
NickGerleman Jul 28, 2022
0bb5ad0
Make sure *.ts files are considered for task avoidance in the Gradle …
cortinico Jul 28, 2022
7ade765
Upgrade to Flow 0.183.1
mroch Jul 29, 2022
a5dd0d0
Add postpack hook that undoes prepack
Jul 29, 2022
19ac198
Fix accessibilityState overwriting view's disabled state on Android (…
okwasniewski Jul 29, 2022
d71acb1
Upgrade Metro dependencies to 0.72.0
huntie Jul 29, 2022
b6d2f39
Improve package.json search mechanism for codegenConfig support (#34298)
cortinico Jul 29, 2022
39ca967
Add methods for creating and interacting with BigInt
jpporto Jul 29, 2022
451d13a
Disable calculation of TransformedFrames in Layoutable ShadowNodex
mdvacca Jul 30, 2022
2301494
Bump eslint-config-react-native-community (#34307)
cortinico Aug 1, 2022
cacf866
Bump Gradle to 7.5.0 (#34310)
leotm Aug 1, 2022
45cfd7a
Introduce findPackageJsonFile to address issue with GenerateCodegenAr…
cortinico Aug 1, 2022
0f2320d
chore: upgrade RN CLI to v9.0.0-alpha.9 (#34322)
thymikee Aug 1, 2022
c19e261
Exit early if currentShadowNode cannot be casted
mdvacca Aug 1, 2022
5be018d
VirtualizedList up-to-date state: Remove bad usage in _adjustCellsAro…
NickGerleman Aug 1, 2022
b54ddf7
VirtualizedList up-to-date state: Move Props to VirtualizedListProps
NickGerleman Aug 1, 2022
078482f
VirtualizedList up-to-date state: Remove _isVirtualizationDisabled()
NickGerleman Aug 1, 2022
14afaa8
Fix Macro Errors for Windows (#34299)
chiaramooney Aug 2, 2022
79ab4ad
Revert D38280674: Multisect successfully blamed D38280674 for test or…
Aug 2, 2022
dc75180
Update ktfmt component on FBS:master
cgrushko Aug 2, 2022
9c667d9
VirtualizedList up-to-date state: Thread props to _updateViewableItems()
NickGerleman Aug 2, 2022
bf25726
VirtualizedList up-to-date state: Thread props to computeWindowedRend…
NickGerleman Aug 2, 2022
f366f26
VirtualizedList up-to-date state: Thread props to __getFrameMetrics()
NickGerleman Aug 2, 2022
8882eb1
VirtualizedList up-to-date state: Thread props to _keyExtractor()
NickGerleman Aug 2, 2022
b357227
VirtualizedList up-to-date state: Use correct form of setState() in _…
NickGerleman Aug 2, 2022
2a02a45
VirtualizedList up-to-date state: Thread props to _createViewToken()
NickGerleman Aug 2, 2022
2c9e919
Run ESLint in Danger (#34305)
Aug 2, 2022
d4298be
Fix unexpected ScrollView fling behavior due to Android P bug workaro…
dhleong Aug 2, 2022
db986aa
Fix regression when setting shadow node properties in D38272966 (gith…
rshest Aug 2, 2022
63a99d7
Fix/flat list not calling render items for nullish values when numCol…
Aug 3, 2022
e664018
TalkBack support for ScrollView accessibility announcements (list and…
fabOnReact Aug 3, 2022
2a97474
Fix edge case where prepare_hermes_workspace and build_hermes_macos w…
Aug 3, 2022
e07d60b
Add missing class annotations xplat/js
pieterv Aug 3, 2022
1b1fbaa
Add missing class annotations xplat/js [suppressions]
pieterv Aug 3, 2022
28eb2ea
Add missing class annotations xplat/js [android]
pieterv Aug 4, 2022
efb45d9
Add missing class annotations and lock xplat/js
pieterv Aug 4, 2022
9bff792
Upgrade to Flow 0.184.0
mroch Aug 4, 2022
0632bd7
Removing reactnativeutilsjni as it is built from the same sources as …
SparshaSaha Aug 4, 2022
df2b226
fix(android): Append `.exe` to hermesc binary path for Windows users …
JoseLion Aug 4, 2022
ef81729
feat: prevent removing globalEvalWithSourceUrl in RELEASE builds (#34…
EvanBacon Aug 4, 2022
76c773b
PointerEvents: Use event.getSource() to distinguish
Aug 4, 2022
5101822
PointerEvents: Fix targetting for secondary touches
Aug 4, 2022
196caec
Add isPrimary and other properties on PointerEvent
Aug 4, 2022
387a36b
Make RuntimeAdapter use only HermesRuntime
mattbfb Aug 4, 2022
39a390a
Provide a HermesRuntime from RuntimeAdapter
mattbfb Aug 4, 2022
ecf0a28
Use HermesRuntime to disable debugging
mattbfb Aug 4, 2022
a85b685
Use RuntimeAdapter to disable debugging
mattbfb Aug 4, 2022
3e178dc
Avoid full copy of large folly::dynamic objects in JSIExecutor#defaul…
christophpurrer Aug 4, 2022
73dbe99
VirtualizedList up-to-date state: Enforce correct `setState()` usage
NickGerleman Aug 5, 2022
9f2bac9
Remove react_native_new_architecture.enable_runtimescheduler_in_turbo…
sammy-SC Aug 5, 2022
8711f1f
Revert D38242964: Multisect successfully blamed D38242964 for test or…
Aug 5, 2022
dc6db29
Fix layout MountItem logging
JoshuaGross Aug 6, 2022
dcfbad1
Back out "TalkBack support for ScrollView accessibility announcements…
genkikondo Aug 6, 2022
ee7a8c3
Fix reload hang after debugger break and continue (#34342)
aeulitz Aug 8, 2022
925dbb0
Fix Make Unused Not Compiler Specific (#34357)
chiaramooney Aug 8, 2022
5ead1b1
Update caniuse-lite with `npx browserslist@latest --update-db`
cortinico Aug 8, 2022
e91a608
Bump Gradle to 7.5.1 (#34359)
AlexanderEggers Aug 8, 2022
40f64ee
Setup a build matrix for test_android_template (#34355)
cortinico Aug 8, 2022
0687c9e
Remove redundant _forceDispatchNextScrollEvent calls
sammy-SC Aug 8, 2022
20b35a7
Early exit in scrollToOffset if contentOffset wouldn't change
sammy-SC Aug 8, 2022
8d0eac0
add 0.69.4 changelog (#34367)
kelset Aug 8, 2022
345ac79
Fix `HBC_SOURCEMAP_FILE` in `scripts/react-native-xcode.sh` (#34111)
kidroca Aug 8, 2022
34bbddc
fix: react android kotlin plugin version conflict (#34255)
hurali97 Aug 8, 2022
e0e681f
Update the new app template to use CMake instead of Android.mk (#34354)
cortinico Aug 8, 2022
f8bcd6c
add 0.68.3 changelog (#34366)
kelset Aug 8, 2022
87520a6
Silence deprecation warning for react-native dependency. (#34368)
Aug 8, 2022
e91e6ef
Make clang-format work in M1 (Apple Silicon)
christophpurrer Aug 8, 2022
7a723bc
React Native sync for revisions d300ceb...9e3b772
sammy-SC Aug 8, 2022
a78a3eb
Add "KeyboardExample" to RNTester
NickGerleman Aug 9, 2022
1b2d15e
Expose UI_MODE_TYPE_VR_HEADSET in PlatformConstants
NickGerleman Aug 9, 2022
9ffe8f0
Setup Automatic Rebase given a /rebase comment (#34369)
cortinico Aug 9, 2022
f0bc763
Let danger run on `pull_request_target` (#34370)
cortinico Aug 9, 2022
0797570
Enable Flipper for custom Xcode configurations (#34333)
scarlac Aug 9, 2022
5dc98d1
Avoid keypress event when text is pasted on macOS
christophpurrer Aug 9, 2022
5c2edb6
Add a pointer event attributes test variant for no-hover pointers
vincentriemer Aug 9, 2022
3c39404
rn | Improve bridging, allowing implicit conversion of jsi types wrap…
nlutsenko Aug 9, 2022
3fcee9a
Replace `experimental.env_mode=resolved` with `inference_mode=constra…
SamChou19815 Aug 10, 2022
b339678
Simplify TurboModule setup (#34373)
Aug 10, 2022
61ee255
fix: try to run dange in PR correctly (#34375)
Aug 10, 2022
dc20ea8
Roll out turbo_module_binding_mode experiment
javache Aug 10, 2022
ebb3c36
Fix USE_HERMES envvar check
Aug 10, 2022
0bdff20
adding importantForAccessibility for Text, Button, ImageBackground (#…
fabOnReact Aug 10, 2022
d01bbbe
Fix typos in ReactCxxErrorHandler message
huntie Aug 10, 2022
d62adfe
Add pointer events to text view config
genkikondo Aug 10, 2022
3bdc358
Fix ghost leave/out events firing due to view recycling
vincentriemer Aug 10, 2022
fb14af7
Collapse catch blocks in template (#34379)
danilobuerger Aug 11, 2022
2678f9a
Use WindowInsetsCompat for Keyboard Events
NickGerleman Aug 11, 2022
a0f7627
Correctly reset pivot when recyling views
javache Aug 11, 2022
fd45aaf
Isolate the buck OSS commands inside test_buck (#34378)
cortinico Aug 11, 2022
cf050ae
Enable -Wpedantic for targets inside ReactCommon
NickGerleman Aug 11, 2022
234993f
Remove molly dep from react-native buck graph
javache Aug 11, 2022
f989bd2
Do not load Flipper via reflection (#34383)
cortinico Aug 11, 2022
71a7bf8
chore(deps): bump CLI to latest v9 alpha (#34385)
kelset Aug 11, 2022
8386eab
Add ability to store and retrieve a list of MapBuffer
luluwu2032 Aug 11, 2022
88331e2
Do not use kwargs which are not known in Buck OSS (#34388)
cortinico Aug 11, 2022
2ba838e
Add needsOffscreenAlphaCompositing to view config
genkikondo Aug 11, 2022
b371e48
Revise Prop Types Error Message (#34392)
yungsters Aug 11, 2022
eb00028
Do not store .cpp/.h files inside src/main/java - reactperflogger (#3…
cortinico Aug 12, 2022
04029fb
Identify debug sessions with a token
mattbfb Aug 12, 2022
e4ee615
Back out "Roll out turbo_module_binding_mode experiment"
makovkastar Aug 12, 2022
4148717
RN: Minor Flow Cleanup in `FlatList`
yungsters Aug 13, 2022
d20c21f
RN: Cleanup Existing ESLint Warnings
yungsters Aug 13, 2022
45a1109
Enable -Wpedantic in OSS Android Targets (#34403)
NickGerleman Aug 13, 2022
839a68d
Update ruby codegen to cleanup build folder. (#34398)
Aug 15, 2022
5390541
Create RCTAppDelegate to simplify New Architecture Setup (#34384)
Aug 15, 2022
2ef633b
Remove deprecated jni.srcDirs from ReactAndroid build file
cortinico Aug 15, 2022
2a5ed5f
Make sure the template project name is `helloworld_appmodules` (#34417)
cortinico Aug 15, 2022
bb2b9da
React Native sync for revisions 9e3b772...a8c9cb1
sammy-SC Aug 15, 2022
cbcb3c7
Do not store .cpp/.h files inside src/main/java - uimanager
cortinico Aug 15, 2022
6cbd343
Do not store .cpp/.h files inside src/main/java - jscexecutor (#34396)
cortinico Aug 15, 2022
66ed39f
Unify platform behavior of processTransform (#33579)
acoates-ms Aug 15, 2022
261ddc2
Remove unused flags `ENABLE_FABRIC` and `ENABLE_TURBOMODULE` inside R…
cortinico Aug 15, 2022
d19445b
Do not store .cpp/.h files inside src/main/java - hermes modules (#34…
cortinico Aug 15, 2022
ff9e0c7
Run ExceptionsManager unit tests in both __DEV__ and prod mode
GijsWeterings Aug 15, 2022
c86464b
Add ability to add custom extraData to errors passed to ExceptionsMan…
GijsWeterings Aug 15, 2022
70b906f
Add iOS implementation of the button property of the PointerEvent object
vincentriemer Aug 15, 2022
5e244c6
Add support for pointerover and pointerout
Aug 15, 2022
4f509eb
Configure `@react-native-community/eslint-config` as a yarn workspace…
yungsters Aug 16, 2022
220760a
Do not store .cpp/.h files inside src/main/java - mapbuffer
cortinico Aug 16, 2022
02569dd
accessibilityLabelledBy use DynamicFromObject to parse String to Dyna…
fabOnReact Aug 16, 2022
6b83e00
Remove unnecessary configs from RNTester
cortinico Aug 16, 2022
62330c6
Do not store .cpp/.h files inside src/main/java - reactnativeblob (#3…
cortinico Aug 16, 2022
6b21b75
Provide defaults for TurboModuleManagerDelegate and JSIModulePackage …
cortinico Aug 16, 2022
c6d539a
Do not use reflection to load Flipper on RN Tester
cortinico Aug 16, 2022
16d70ae
Fix nohover pointerevent attributes test
vincentriemer Aug 16, 2022
9ab0243
Show highlight when element is selected in React devtools
tyao1 Aug 16, 2022
a326144
Support MapBuffer in TextInput State
JoshuaGross Aug 16, 2022
e6df5cd
Fix logging crash in IntBufferMountItem
JoshuaGross Aug 16, 2022
f914e8c
Fix PropSetter parsing of borderRadius
JoshuaGross Aug 16, 2022
c1a614f
React Native sync for revisions a8c9cb1...256aefb
sammy-SC Aug 17, 2022
c947e1b
Update template to gitignore `android/app/.cxx` (#34430)
leotm Aug 17, 2022
d1ef370
feat(font-feature): adding stylistics from ss01 to ss20 as new fontVa…
Aug 17, 2022
6f0c1c0
Delete feature flag enable_call_immediates_android
sammy-SC Aug 17, 2022
38b5250
Do not store .cpp/.h files inside src/main/java - fabricjni (#34435)
cortinico Aug 17, 2022
17565e4
Fix test_buck by providing exported deps for textinput target (#34436)
cortinico Aug 17, 2022
9c5e465
Add flexlayout dirSync to react-native-github
Aug 17, 2022
07ea97c
Enable pedantic warnings in C++ podspecs (#34404)
NickGerleman Aug 17, 2022
f204f5d
Merge pull request #26 from Expensify/Rory-SyncWithUpstream
roryabraham Aug 17, 2022
f208b6b
Add deploy instructions back to README
roryabraham Aug 30, 2022
9ae49b1
Merge branch 'upstream/main'
roryabraham Aug 30, 2022
73a8f0f
Merge pull request #27 from Expensify/Rory-AddBackDeployInstructions
luacmartins Aug 30, 2022
4e25753
Merge branch 'main' of github.com:Expensify/react-native
roryabraham Sep 6, 2022
89fc763
Merge branch 'main' into Rory-UpdateForkFromUpstream
roryabraham Sep 6, 2022
6e9d4bf
Merge pull request #30 from Expensify/Rory-UpdateForkFromUpstream
cead22 Sep 6, 2022
95d3b1f
add `verticalScrollbarPosition` prop to `ScrollView`
hannojg Nov 17, 2022
99c26e2
Merge pull request #33 from hannojg/feat/scrollview-add-scrollvar-pos…
Beamanator Nov 21, 2022
0d9a5d8
Update the PR template to include a higher bar for quality
tgolen Jan 18, 2023
9837731
Merge pull request #38 from Expensify/tgolen-pull-request-template
roryabraham Jan 19, 2023
f38dc75
[IOS] Add smartInsertDelete prop to TextInput component
fabioh8010 Feb 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<!-- !!!!FILLING OUT THIS TEMPLATE COMPLETELY AND WITH GOOD QUALITY IS MANDATORY!!!! -->

<!-- Thanks for submitting a pull request! We appreciate you spending the time to work on these changes. Please provide enough information so that others can review your pull request. The three fields below are mandatory. -->

# Upstream PR Link
<!-- For the Expensify fork of React-Native, every PR should also be made to the upstream source of React-Native. Provide a link to that PR here. If there is no upstream PR, write a good and detailed explanation of why. -->

## Summary

<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->
Expand Down
1 change: 1 addition & 0 deletions Libraries/Components/TextInput/RCTTextInputViewConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ const RCTTextInputViewConfig = {
clearTextOnFocus: true,
showSoftInputOnFocus: true,
autoFocus: true,
smartInsertDelete: true,
...ConditionallyIgnoredEventHandlers({
onChange: true,
onSelectionChange: true,
Expand Down
10 changes: 10 additions & 0 deletions Libraries/Components/TextInput/TextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,16 @@ type IOSProps = $ReadOnly<{|
* @platform ios
*/
textContentType?: ?TextContentType,

/**
* If `false`, the iOS system will not insert an extra space after a paste operation
* neither delete one or two spaces after a cut or delete operation.
*
* The default value is `true`.
*
* @platform ios
*/
smartInsertDelete?: ?boolean,
|}>;

type AndroidProps = $ReadOnly<{|
Expand Down
1 change: 1 addition & 0 deletions Libraries/NativeComponent/BaseViewConfig.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ const validAttributesForNonEventProps = {
translateX: true,
translateY: true,
accessibilityLiveRegion: true,
needsOffscreenAlphaCompositing: true,

// @ReactProps from LayoutShadowNode
width: true,
Expand Down
1 change: 1 addition & 0 deletions Libraries/Text/RCTConvert+Text.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
+ (UITextAutocorrectionType)UITextAutocorrectionType:(nullable id)json;
+ (UITextSpellCheckingType)UITextSpellCheckingType:(nullable id)json;
+ (RCTTextTransform)RCTTextTransform:(nullable id)json;
+ (UITextSmartInsertDeleteType)UITextSmartInsertDeleteType:(nullable id)json;

@end

Expand Down
7 changes: 7 additions & 0 deletions Libraries/Text/RCTConvert+Text.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,11 @@ + (UITextSpellCheckingType)UITextSpellCheckingType:(id)json
@"lowercase": @(RCTTextTransformLowercase),
}), RCTTextTransformUndefined, integerValue)

+ (UITextSmartInsertDeleteType)UITextSmartInsertDeleteType:(id)json
{
return json == nil ? UITextSmartInsertDeleteTypeDefault
: [RCTConvert BOOL:json] ? UITextSmartInsertDeleteTypeYes
: UITextSmartInsertDeleteTypeNo;
}

@end
1 change: 1 addition & 0 deletions Libraries/Text/TextInput/RCTBaseTextInputViewManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ @implementation RCTBaseTextInputViewManager
RCT_REMAP_VIEW_PROPERTY(clearButtonMode, backedTextInputView.clearButtonMode, UITextFieldViewMode)
RCT_REMAP_VIEW_PROPERTY(scrollEnabled, backedTextInputView.scrollEnabled, BOOL)
RCT_REMAP_VIEW_PROPERTY(secureTextEntry, backedTextInputView.secureTextEntry, BOOL)
RCT_REMAP_VIEW_PROPERTY(smartInsertDelete, backedTextInputView.smartInsertDeleteType, UITextSmartInsertDeleteType)
RCT_EXPORT_VIEW_PROPERTY(autoFocus, BOOL)
RCT_EXPORT_VIEW_PROPERTY(submitBehavior, NSString)
RCT_EXPORT_VIEW_PROPERTY(clearTextOnFocus, BOOL)
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# Expensify Release

To release this fork to npm there are a couple manual steps needed.

If updating the base react-native version of the fork:

1. Update the `version` variable on line 15 in `sdks/hermes-engine/hermes-engine.podspec` with the version of react-native the fork is based on. For example `version = '0.69.3'`.
2. Download hermesc from the version of react-native the fork is based on. This can be done by opening the url `https://registry.npmjs.com/react-native/-/react-native-<version>.tgz`. For example `https://registry.npmjs.com/react-native/-/react-native-0.69.3.tgz`. Then copy `sdks/hermesc` to the same directory inside your react-native repository.
3. Commit the updated files.

Build and publish the fork:

1. Clean previous build if there is one in `android` folder with `rm -rf android`.
2. Run `node scripts/set-rn-version.js --to-version <version>` where version is the version of the **fork** that is being published, note that this might be different that the version the fork is based on we used previously. For example `node scripts/set-rn-version.js --to-version 0.69.4`.
3. Run `CIRCLE_TAG=<version> node ./scripts/publish-npm.js` where version is the same as the one in the previous step. For example `CIRCLE_TAG=0.69.4 node ./scripts/publish-npm.js`.

<h1 align="center">
<a href="https://reactnative.dev/">
React Native
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,13 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &
}
}

if (newTextInputProps.traits.smartInsertDelete != oldTextInputProps.traits.smartInsertDelete) {
if (@available(iOS 11.0, *)) {
_backedTextInputView.smartInsertDeleteType =
RCTUITextSmartInsertDeleteTypeFromOptionalBool(newTextInputProps.traits.smartInsertDelete);
}
}

// Traits `blurOnSubmit`, `clearTextOnFocus`, and `selectTextOnFocus` were omitted intentially here
// because they are being checked on-demand.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,7 @@ UITextContentType RCTUITextContentTypeFromString(std::string const &contentType)
API_AVAILABLE(ios(12.0))
UITextInputPasswordRules *RCTUITextInputPasswordRulesFromString(std::string const &passwordRules);

API_AVAILABLE(ios(11.0))
UITextSmartInsertDeleteType RCTUITextSmartInsertDeleteTypeFromOptionalBool(std::optional<bool> smartInsertDelete);

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ void RCTCopyBackedTextInput(
toTextInput.keyboardType = fromTextInput.keyboardType;
toTextInput.textContentType = fromTextInput.textContentType;

if (@available(iOS 11.0, *)) {
toTextInput.smartInsertDeleteType = fromTextInput.smartInsertDeleteType;
}

if (@available(iOS 12.0, *)) {
toTextInput.passwordRules = fromTextInput.passwordRules;
}
Expand Down Expand Up @@ -232,3 +236,10 @@ UITextContentType RCTUITextContentTypeFromString(std::string const &contentType)
{
return [UITextInputPasswordRules passwordRulesWithDescriptor:RCTNSStringFromStringNilIfEmpty(passwordRules)];
}

API_AVAILABLE(ios(11.0))
UITextSmartInsertDeleteType RCTUITextSmartInsertDeleteTypeFromOptionalBool(std::optional<bool> smartInsertDelete)
{
return smartInsertDelete.has_value() ? (*smartInsertDelete ? UITextSmartInsertDeleteTypeYes : UITextSmartInsertDeleteTypeNo)
: UITextSmartInsertDeleteTypeDefault;
}
Original file line number Diff line number Diff line change
Expand Up @@ -375,4 +375,15 @@ public void setPointerEvents(ReactScrollView view, @Nullable String pointerEvent
public void setScrollEventThrottle(ReactScrollView view, int scrollEventThrottle) {
view.setScrollEventThrottle(scrollEventThrottle);
}

@ReactProp(name = "verticalScrollbarPosition")
public void setVerticalScrollbarPosition(ReactScrollView view, String position) {
if ("right".equals(position)) {
view.setVerticalScrollbarPosition(View.SCROLLBAR_POSITION_RIGHT);
} else if ("left".equals(position)) {
view.setVerticalScrollbarPosition(View.SCROLLBAR_POSITION_LEFT);
} else {
view.setVerticalScrollbarPosition(View.SCROLLBAR_POSITION_DEFAULT);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,15 @@ class TextInputTraits final {
* Default value: `<empty string>` (no rules).
*/
std::string passwordRules{};

/*
* If `false`, the iOS system will not insert an extra space after a paste operation
* neither delete one or two spaces after a cut or delete operation.
* iOS-only (inherently iOS-specific)
* Can be empty (`null` in JavaScript) which means `default`.
* Default value: `empty` (`null`).
*/
std::optional<bool> smartInsertDelete{};
};

} // namespace react
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ static TextInputTraits convertRawProp(
"passwordRules",
sourceTraits.passwordRules,
defaultTraits.passwordRules);
traits.smartInsertDelete = convertRawProp(
context,
rawProps,
"smartInsertDelete",
sourceTraits.smartInsertDelete,
defaultTraits.smartInsertDelete);

return traits;
}
Expand Down
19 changes: 19 additions & 0 deletions packages/rn-tester/js/examples/TextInput/TextInputExample.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -847,4 +847,23 @@ exports.examples = ([
);
},
},
{
title: 'iOS autoformatting behaviors',
render: function (): React.Node {
return (
<View>
<WithLabel label="smartInsertDelete: true | undefined">
<TextInput style={styles.default} defaultValue="CopyAndPaste" />
</WithLabel>
<WithLabel label="smartInsertDelete: false">
<TextInput
smartInsertDelete={false}
style={styles.default}
defaultValue="CopyAndPaste"
/>
</WithLabel>
</View>
);
},
},
]: Array<RNTesterModuleExample>);