react-native-tvos 0.86.0-0rc3 → 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.
@@ -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 = '0rc3';
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}` : ''}`;
@@ -60,8 +60,6 @@ component LogBoxButton(
60
60
  focusable={true}
61
61
  hitSlop={hitSlop}
62
62
  onPress={onPress}
63
- onPressIn={() => setPressed(true)}
64
- onPressOut={() => setPressed(false)}>
65
63
  onFocus={() => {
66
64
  setFocused(true);
67
65
  onFocusChange?.(true);
@@ -24,7 +24,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(86),
26
26
  RCTVersionPatch: @(0),
27
- RCTVersionPrerelease: @"0rc3",
27
+ RCTVersionPrerelease: @"2",
28
28
  };
29
29
  });
30
30
  return __rnVersion;
@@ -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
- [_scrollView setContentOffset:targetContentOffset animated:scrollProps.scrollAnimationEnabled];
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).
@@ -630,11 +630,10 @@ static BOOL RCTLayerTransformCollapsesAxis(CALayer *layer)
630
630
  // [self isTVFocusGuide] is false when autofocus and destinations are not used, so we cannot use that.
631
631
  // Generally speaking, it would happen for any non-collapsable `View`.
632
632
  } else if (context.previouslyFocusedView == self) {
633
- [self disableDirectionalFocusGuides];
634
633
  [coordinator addCoordinatedAnimations:^(void){
635
634
  [self removeParallaxMotionEffects];
636
635
  if (self->_eventEmitter) self->_eventEmitter->onBlur();
637
- } completion:^(void){}];
636
+ } completion:^(void){[self disableDirectionalFocusGuides];}];
638
637
  [self resignFirstResponder];
639
638
  }
640
639
  }
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.86.0-0rc3
1
+ VERSION_NAME=0.86.0-2
2
2
  react.internal.publishingGroup=io.github.react-native-tvos
3
3
  react.internal.hermesPublishingGroup=com.facebook.hermes
4
4
 
@@ -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")
@@ -15,6 +15,6 @@ public object ReactNativeVersion {
15
15
  "major" to 0,
16
16
  "minor" to 86,
17
17
  "patch" to 0,
18
- "prerelease" to "0rc3"
18
+ "prerelease" to "2"
19
19
  )
20
20
  }
@@ -22,7 +22,7 @@ struct ReactNativeVersionType {
22
22
  int32_t Major = 0;
23
23
  int32_t Minor = 86;
24
24
  int32_t Patch = 0;
25
- std::string_view Prerelease = "0rc3";
25
+ std::string_view Prerelease = "2";
26
26
  };
27
27
 
28
28
  constexpr ReactNativeVersionType ReactNativeVersion;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-tvos",
3
- "version": "0.86.0-0rc3",
3
+ "version": "0.86.0-2",
4
4
  "description": "A framework for building native apps using React",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -154,7 +154,7 @@
154
154
  "featureflags-check": "node ./scripts/featureflags/index.js --verify-unchanged"
155
155
  },
156
156
  "peerDependencies": {
157
- "@react-native/jest-preset": "0.86.0-rc.3",
157
+ "@react-native/jest-preset": "0.86.0",
158
158
  "@types/react": "^19.1.1",
159
159
  "react": "^19.2.3"
160
160
  },
@@ -167,12 +167,12 @@
167
167
  }
168
168
  },
169
169
  "dependencies": {
170
- "@react-native/assets-registry": "0.86.0-rc.3",
171
- "@react-native/codegen": "0.86.0-rc.3",
172
- "@react-native/community-cli-plugin": "0.86.0-rc.3",
173
- "@react-native/gradle-plugin": "0.86.0-rc.3",
174
- "@react-native/js-polyfills": "0.86.0-rc.3",
175
- "@react-native/normalize-colors": "0.86.0-rc.3",
170
+ "@react-native/assets-registry": "0.86.0",
171
+ "@react-native/codegen": "0.86.0",
172
+ "@react-native/community-cli-plugin": "0.86.0",
173
+ "@react-native/gradle-plugin": "0.86.0",
174
+ "@react-native/js-polyfills": "0.86.0",
175
+ "@react-native/normalize-colors": "0.86.0",
176
176
  "abort-controller": "^3.0.0",
177
177
  "anser": "^1.4.9",
178
178
  "ansi-regex": "^5.0.0",
@@ -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-0rc3"
201
+ "@react-native-tvos/virtualized-lists": "0.86.0-2"
202
202
  },
203
203
  "codegenConfig": {
204
204
  "libraries": [