|
| 1 | +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 |
| 2 | +index 1b8a228..1efeb14 100644 |
| 3 | +--- a/node_modules/react-native-web/dist/vendor/react-native/VirtualizedList/index.js |
| 4 | ++++ b/node_modules/react-native-web/dist/vendor/react-native/VirtualizedList/index.js |
| 5 | +@@ -719,21 +719,22 @@ class VirtualizedList extends StateSafePureComponent { |
| 6 | + const targetDelta = delta - leftoverDelta; |
| 7 | + if (this.props.inverted && this._scrollRef && this._scrollRef.getScrollableNode) { |
| 8 | + const node = this._scrollRef.getScrollableNode(); |
| 9 | +- if (isHorizontal) { |
| 10 | +- ev.target.scrollLeft += targetDelta; |
| 11 | +- const nextScrollLeft = node.scrollLeft - leftoverDelta; |
| 12 | +- node.scrollLeft = !this.props.getItemLayout ? Math.min(nextScrollLeft, this._totalCellLength) : nextScrollLeft; |
| 13 | + |
| 14 | ++ if (isHorizontal) { |
| 15 | + if (Math.abs(deltaX) > Math.abs(deltaY)) { |
| 16 | +- ev.preventDefault(); |
| 17 | ++ ev.target.scrollLeft += targetDelta; |
| 18 | ++ const nextScrollLeft = node.scrollLeft - leftoverDelta; |
| 19 | ++ node.scrollLeft = !this.props.getItemLayout ? Math.min(nextScrollLeft, this._totalCellLength) : nextScrollLeft; |
| 20 | ++ ev.preventDefault(); |
| 21 | ++ ev.stopPropagation(); |
| 22 | + } |
| 23 | + } else { |
| 24 | +- ev.target.scrollTop += targetDelta; |
| 25 | +- const nextScrollTop = node.scrollTop - leftoverDelta; |
| 26 | +- node.scrollTop = !this.props.getItemLayout ? Math.min(nextScrollTop, this._totalCellLength) : nextScrollTop; |
| 27 | +- |
| 28 | + if (Math.abs(deltaY) > Math.abs(deltaX)) { |
| 29 | +- ev.preventDefault(); |
| 30 | ++ ev.target.scrollTop += targetDelta; |
| 31 | ++ const nextScrollTop = node.scrollTop - leftoverDelta; |
| 32 | ++ node.scrollTop = !this.props.getItemLayout ? Math.min(nextScrollTop, this._totalCellLength) : nextScrollTop; |
| 33 | ++ ev.preventDefault(); |
| 34 | ++ ev.stopPropagation(); |
| 35 | + } |
| 36 | + } |
| 37 | + } |
0 commit comments