forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
/
react-native-web+0.19.13+002+fixLastSpacer.patch
43 lines (42 loc) · 2.14 KB
/
react-native-web+0.19.13+002+fixLastSpacer.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
diff --git a/node_modules/react-native-web/dist/modules/AccessibilityUtil/propsToAccessibilityComponent.js b/node_modules/react-native-web/dist/modules/AccessibilityUtil/propsToAccessibilityComponent.js
index 7d1d587..de51afe 100644
--- a/node_modules/react-native-web/dist/modules/AccessibilityUtil/propsToAccessibilityComponent.js
+++ b/node_modules/react-native-web/dist/modules/AccessibilityUtil/propsToAccessibilityComponent.js
@@ -27,7 +27,8 @@ var roleComponents = {
navigation: 'nav',
paragraph: 'p',
region: 'section',
- strong: 'strong'
+ strong: 'strong',
+ switch: 'button'
};
var emptyObject = {};
var propsToAccessibilityComponent = function propsToAccessibilityComponent(props) {
diff --git a/node_modules/react-native-web/dist/vendor/react-native/VirtualizedList/index.js b/node_modules/react-native-web/dist/vendor/react-native/VirtualizedList/index.js
index 53b1a83..5689220 100644
--- a/node_modules/react-native-web/dist/vendor/react-native/VirtualizedList/index.js
+++ b/node_modules/react-native-web/dist/vendor/react-native/VirtualizedList/index.js
@@ -78,14 +78,6 @@ function scrollEventThrottleOrDefault(scrollEventThrottle) {
function windowSizeOrDefault(windowSize) {
return windowSize !== null && windowSize !== void 0 ? windowSize : 21;
}
-function findLastWhere(arr, predicate) {
- for (var i = arr.length - 1; i >= 0; i--) {
- if (predicate(arr[i])) {
- return arr[i];
- }
- }
- return null;
-}
/**
* Base implementation for the more convenient [`<FlatList>`](https://reactnative.dev/docs/flatlist)
@@ -1109,7 +1101,8 @@ class VirtualizedList extends StateSafePureComponent {
_keylessItemComponentName = '';
var spacerKey = this._getSpacerKey(!horizontal);
var renderRegions = this.state.renderMask.enumerateRegions();
- var lastSpacer = findLastWhere(renderRegions, r => r.isSpacer);
+ var lastRegion = renderRegions[renderRegions.length - 1];
+ var lastSpacer = lastRegion?.isSpacer ? lastRegion : null;
for (var _iterator = _createForOfIteratorHelperLoose(renderRegions), _step; !(_step = _iterator()).done;) {
var section = _step.value;
if (section.isSpacer) {