react-native-tvos 0.86.0-1 → 0.86.0-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/LogBox/UI/LogBoxButton.js +0 -2
- package/React/Base/RCTVersion.m +1 -1
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +13 -1
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +11 -0
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/ReactAndroidHWInputDeviceHelper.java +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/package.json +2 -2
|
@@ -29,7 +29,7 @@ export default class ReactNativeVersion {
|
|
|
29
29
|
static major: number = 0;
|
|
30
30
|
static minor: number = 86;
|
|
31
31
|
static patch: number = 0;
|
|
32
|
-
static prerelease: string | null = '
|
|
32
|
+
static prerelease: string | null = '2';
|
|
33
33
|
|
|
34
34
|
static getVersionString(): string {
|
|
35
35
|
return `${this.major}.${this.minor}.${this.patch}${this.prerelease != null ? `-${this.prerelease}` : ''}`;
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -1274,8 +1274,20 @@ static inline UIViewAnimationOptions animationOptionsWithCurve(UIViewAnimationCu
|
|
|
1274
1274
|
CGPoint targetContentOffset = isHorizontalSnap
|
|
1275
1275
|
? CGPointMake(targetOffset, scrollView.contentOffset.y)
|
|
1276
1276
|
: CGPointMake(scrollView.contentOffset.x, targetOffset);
|
|
1277
|
+
// Where the focused item should snap to. We don't scroll to it here: this view's
|
|
1278
|
+
// scrollViewWillEndDragging:withVelocity:targetContentOffset: override sets
|
|
1279
|
+
// *targetContentOffset = preferredContentOffset. On tvOS the focus engine routes its
|
|
1280
|
+
// focus-driven scroll through that delegate, so the item snaps to this offset via the
|
|
1281
|
+
// engine's own scroll, even when it's already on screen. An explicit setContentOffset here
|
|
1282
|
+
// would just scroll a second time.
|
|
1283
|
+
// https://developer.apple.com/documentation/uikit/uiscrollviewdelegate/scrollviewwillenddragging(_:withvelocity:targetcontentoffset:)
|
|
1284
|
+
// https://developer.apple.com/forums/thread/22103?answerId=73300022#73300022
|
|
1277
1285
|
self.preferredContentOffset = targetContentOffset;
|
|
1278
|
-
|
|
1286
|
+
if (!scrollProps.scrollAnimationEnabled) {
|
|
1287
|
+
// Animations off: RCTEnhancedScrollView.didUpdateFocusInContext blocks the engine's
|
|
1288
|
+
// scroll, so the delegate never fires — set the offset directly.
|
|
1289
|
+
scrollView.contentOffset = targetContentOffset;
|
|
1290
|
+
}
|
|
1279
1291
|
}
|
|
1280
1292
|
|
|
1281
1293
|
- (void)didUpdateFocusInContext:(UIFocusUpdateContext *)context
|
|
@@ -771,12 +771,23 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
|
|
771
771
|
|
|
772
772
|
- (void)_setAttributedString:(NSAttributedString *)attributedString
|
|
773
773
|
{
|
|
774
|
+
#if TARGET_OS_TV
|
|
775
|
+
// Attribute-free string prevents the tvOS keyboard from inheriting the component's small font.
|
|
776
|
+
if ([attributedString.string isEqualToString:_backedTextInputView.attributedText.string]) {
|
|
777
|
+
return;
|
|
778
|
+
}
|
|
779
|
+
#else
|
|
774
780
|
if ([self _textOf:attributedString equals:_backedTextInputView.attributedText]) {
|
|
775
781
|
return;
|
|
776
782
|
}
|
|
783
|
+
#endif
|
|
777
784
|
UITextRange *selectedRange = _backedTextInputView.selectedTextRange;
|
|
778
785
|
NSInteger oldTextLength = _backedTextInputView.attributedText.string.length;
|
|
786
|
+
#if TARGET_OS_TV
|
|
787
|
+
_backedTextInputView.attributedText = [[NSAttributedString alloc] initWithString:attributedString.string];
|
|
788
|
+
#else
|
|
779
789
|
_backedTextInputView.attributedText = attributedString;
|
|
790
|
+
#endif
|
|
780
791
|
// Updating the UITextView attributedText, for example changing the lineHeight, the color or adding
|
|
781
792
|
// a new paragraph with \n, causes the cursor to move to the end of the Text and scroll.
|
|
782
793
|
// This is fixed by restoring the cursor position and scrolling to that position (iOS issue 652653).
|
|
@@ -63,6 +63,7 @@ public class ReactAndroidHWInputDeviceHelper {
|
|
|
63
63
|
.put(KeyEvent.KEYCODE_9, "9")
|
|
64
64
|
.put(KeyEvent.KEYCODE_CHANNEL_DOWN, "channelDown")
|
|
65
65
|
.put(KeyEvent.KEYCODE_CHANNEL_UP, "channelUp")
|
|
66
|
+
.put(KeyEvent.KEYCODE_DEL, "delete")
|
|
66
67
|
.put(KeyEvent.KEYCODE_BOOKMARK, "bookmark")
|
|
67
68
|
.put(KeyEvent.KEYCODE_AVR_INPUT, "avrInput")
|
|
68
69
|
.put(KeyEvent.KEYCODE_AVR_POWER, "avrPower")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-tvos",
|
|
3
|
-
"version": "0.86.0-
|
|
3
|
+
"version": "0.86.0-2",
|
|
4
4
|
"description": "A framework for building native apps using React",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -198,7 +198,7 @@
|
|
|
198
198
|
"whatwg-fetch": "^3.0.0",
|
|
199
199
|
"ws": "^7.5.10",
|
|
200
200
|
"yargs": "^17.6.2",
|
|
201
|
-
"@react-native-tvos/virtualized-lists": "0.86.0-
|
|
201
|
+
"@react-native-tvos/virtualized-lists": "0.86.0-2"
|
|
202
202
|
},
|
|
203
203
|
"codegenConfig": {
|
|
204
204
|
"libraries": [
|