react-native-tvos 0.81.5-0 → 0.81.5-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/Components/TV/TVFocusGuideView.js +5 -3
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/React/Base/RCTVersion.m +1 -1
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +1 -2
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.kt +8 -20
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.kt +2 -3
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/package.json +2 -2
|
@@ -104,10 +104,12 @@ function TVFocusGuideView({
|
|
|
104
104
|
const mergedRef = useMergeRefs(setLocalRef, ref);
|
|
105
105
|
|
|
106
106
|
React.useEffect(() => {
|
|
107
|
-
if (
|
|
107
|
+
if (focusable === false) {
|
|
108
|
+
setDestinations([]);
|
|
109
|
+
} else if (destinationsProp !== null && destinationsProp !== undefined) {
|
|
108
110
|
setDestinations(destinationsProp); // $FlowFixMe[incompatible-call]
|
|
109
111
|
}
|
|
110
|
-
}, [setDestinations, destinationsProp]);
|
|
112
|
+
}, [setDestinations, destinationsProp, focusable]);
|
|
111
113
|
|
|
112
114
|
const enabledStyle = {display: enabled ? 'flex' : 'none'};
|
|
113
115
|
const style = [styles.container, props.style, enabledStyle];
|
|
@@ -124,7 +126,7 @@ function TVFocusGuideView({
|
|
|
124
126
|
style={style}
|
|
125
127
|
ref={mergedRef}
|
|
126
128
|
collapsable={false}
|
|
127
|
-
autoFocus={autoFocus}
|
|
129
|
+
autoFocus={focusable === false ? true : autoFocus}
|
|
128
130
|
// tvOS only prop
|
|
129
131
|
isTVSelectable={tvOSSelectable}
|
|
130
132
|
// Android TV only prop
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -1160,7 +1160,6 @@ const CGFloat BACKGROUND_COLOR_ZPOSITION = -1024.0f;
|
|
|
1160
1160
|
// `autoFocus`
|
|
1161
1161
|
if (oldViewProps.autoFocus != newViewProps.autoFocus) {
|
|
1162
1162
|
_autoFocus = newViewProps.autoFocus;
|
|
1163
|
-
[self handleFocusGuide];
|
|
1164
1163
|
}
|
|
1165
1164
|
|
|
1166
1165
|
_trapFocusUp = newViewProps.trapFocusUp;
|
|
@@ -1222,7 +1221,7 @@ const CGFloat BACKGROUND_COLOR_ZPOSITION = -1024.0f;
|
|
|
1222
1221
|
[self requestFocusSelf];
|
|
1223
1222
|
}
|
|
1224
1223
|
}
|
|
1225
|
-
|
|
1224
|
+
[self handleFocusGuide];
|
|
1226
1225
|
#endif
|
|
1227
1226
|
|
|
1228
1227
|
}
|
|
@@ -413,7 +413,7 @@ public open class ReactEditText public constructor(context: Context) : AppCompat
|
|
|
413
413
|
// that. This method will eventually replace requestFocusInternal()
|
|
414
414
|
private fun requestFocusProgrammatically(): Boolean {
|
|
415
415
|
val focused = super.requestFocus(FOCUS_DOWN, null)
|
|
416
|
-
if (
|
|
416
|
+
if (showSoftInputOnFocus) {
|
|
417
417
|
showSoftKeyboard()
|
|
418
418
|
} else {
|
|
419
419
|
if (isKeyboardOpened) {
|
|
@@ -1403,7 +1403,13 @@ public open class ReactViewGroup public constructor(context: Context?) :
|
|
|
1403
1403
|
if (isFocusDestinationsSet) {
|
|
1404
1404
|
val destination = findDestinationView()
|
|
1405
1405
|
|
|
1406
|
-
|
|
1406
|
+
// Destination is set but there's no such element on the tree
|
|
1407
|
+
// Just skip it to prevent cyclic issues.
|
|
1408
|
+
if (destination == null) {
|
|
1409
|
+
return false
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
if (destination.requestFocus()) {
|
|
1407
1413
|
return true
|
|
1408
1414
|
}
|
|
1409
1415
|
}
|
|
@@ -1427,9 +1433,7 @@ public open class ReactViewGroup public constructor(context: Context?) :
|
|
|
1427
1433
|
}
|
|
1428
1434
|
|
|
1429
1435
|
// Try moving the focus to the first focusable element otherwise.
|
|
1430
|
-
|
|
1431
|
-
return true
|
|
1432
|
-
}
|
|
1436
|
+
return moveFocusToFirstFocusable(this)
|
|
1433
1437
|
}
|
|
1434
1438
|
|
|
1435
1439
|
return super.requestFocus(direction, previouslyFocusedRect)
|
|
@@ -1553,21 +1557,5 @@ public open class ReactViewGroup public constructor(context: Context?) :
|
|
|
1553
1557
|
fun setViewClipped(view: View, clipped: Boolean) {
|
|
1554
1558
|
view.setTag(R.id.view_clipped, clipped)
|
|
1555
1559
|
}
|
|
1556
|
-
|
|
1557
|
-
private fun requestFocusViewOrAncestor(destination: View): Boolean {
|
|
1558
|
-
var v: View? = destination
|
|
1559
|
-
while (v != null) {
|
|
1560
|
-
if (v.requestFocus()) {
|
|
1561
|
-
return true
|
|
1562
|
-
}
|
|
1563
|
-
val parent = v.parent
|
|
1564
|
-
v = if (parent is View) {
|
|
1565
|
-
parent
|
|
1566
|
-
} else {
|
|
1567
|
-
null
|
|
1568
|
-
}
|
|
1569
|
-
}
|
|
1570
|
-
return false
|
|
1571
|
-
}
|
|
1572
1560
|
}
|
|
1573
1561
|
}
|
|
@@ -108,7 +108,7 @@ public open class ReactViewManager : ReactClippingViewManager<ReactViewGroup>()
|
|
|
108
108
|
view.isFocusable = false
|
|
109
109
|
view.descendantFocusability = ViewGroup.FOCUS_BLOCK_DESCENDANTS
|
|
110
110
|
} else {
|
|
111
|
-
view.descendantFocusability = ViewGroup.
|
|
111
|
+
view.descendantFocusability = ViewGroup.FOCUS_AFTER_DESCENDANTS
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
|
|
@@ -395,8 +395,7 @@ public open class ReactViewManager : ReactClippingViewManager<ReactViewGroup>()
|
|
|
395
395
|
} else {
|
|
396
396
|
view.setOnClickListener(null)
|
|
397
397
|
view.isClickable = false
|
|
398
|
-
|
|
399
|
-
// accessibility reasons
|
|
398
|
+
view.isFocusable = false
|
|
400
399
|
}
|
|
401
400
|
// This is required to handle Android TV/ Fire TV Devices that are Touch Enabled as well as LeanBack
|
|
402
401
|
// https://developer.android.com/reference/android/view/View#requestFocus(int,%20android.graphics.Rect)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-tvos",
|
|
3
|
-
"version": "0.81.5-
|
|
3
|
+
"version": "0.81.5-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": "^6.2.3",
|
|
200
200
|
"yargs": "^17.6.2",
|
|
201
|
-
"@react-native-tvos/virtualized-lists": "0.81.5-
|
|
201
|
+
"@react-native-tvos/virtualized-lists": "0.81.5-2"
|
|
202
202
|
},
|
|
203
203
|
"codegenConfig": {
|
|
204
204
|
"libraries": [
|