@onekeyfe/react-native-pager-view 3.0.169 → 3.0.170

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/docs/SPEC.md CHANGED
@@ -254,9 +254,11 @@ start a refresh gesture. Non-smooth refresh direction behavior remains unchanged
254
254
  iOS nested horizontal ownership MUST include enabled nonpaging horizontal-only
255
255
  ScrollViews, with content wider than bounds and no vertical content overflow.
256
256
  Both pan holding and failure dependencies MUST use the same eligibility. A
257
- failure dependency on the Pager guard MUST apply only to the horizontal pan;
257
+ failure dependency on the Pager guard MUST apply only to the horizontal pan,
258
+ both on the root Pager ScrollView and on eligible nested horizontal ScrollViews;
258
259
  independent non-pan recognizers, including stationary native long presses, MUST
259
- remain able to recognize before finger-up while Pager intent is pending. A
260
+ remain able to deliver their target actions before finger-up while Pager intent
261
+ is pending. A
260
262
  second touch in the pending Pager guard fails recognition; an already active
261
263
  Pager guard cancels and restores each held pan's original minimum touch count.
262
264
 
@@ -2770,9 +2770,7 @@ static void RNCLogNativeTabScrollBoundary(NSString *owner,
2770
2770
  {
2771
2771
  if (_pagerScrollView != nil && _verticalPagerGesture != nil) {
2772
2772
  _verticalPagerGesture.pagerPan = _pagerScrollView.panGestureRecognizer;
2773
- for (UIGestureRecognizer *gesture in _pagerScrollView.gestureRecognizers) {
2774
- [gesture requireGestureRecognizerToFail:_verticalPagerGesture];
2775
- }
2773
+ [_pagerScrollView.panGestureRecognizer requireGestureRecognizerToFail:_verticalPagerGesture];
2776
2774
  }
2777
2775
  }
2778
2776
 
@@ -1011,6 +1011,37 @@ typedef struct __IOHIDEvent *RNCTestHIDEventRef;
1011
1011
  return point;
1012
1012
  }
1013
1013
 
1014
+ - (void)testRootPagerStationaryNativeLongPressRecognizesBeforeFingerUp
1015
+ {
1016
+ [self assertFixtureIsReadyForDelivery];
1017
+ [self assertDirectPagerForRegression];
1018
+ UIScrollView *pager = [self.pager valueForKey:@"pagerScrollView"];
1019
+ UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc]
1020
+ initWithTarget:self action:@selector(nestedLongPress:)];
1021
+ longPress.minimumPressDuration = 0.1;
1022
+ [pager addGestureRecognizer:longPress];
1023
+ // Exercise production wiring after a root recognizer is attached.
1024
+ ((void (*)(id, SEL))objc_msgSend)(self.pager, NSSelectorFromString(@"connectVerticalPagerGuard"));
1025
+ UITouch *touch = [self.driver beginAt:[self pressPoint]];
1026
+ UIGestureRecognizer *guard = [self.pager valueForKey:@"verticalPagerGesture"];
1027
+ XCTAssertEqual(guard.state, UIGestureRecognizerStatePossible);
1028
+ XCTAssertEqual(pager.panGestureRecognizer.minimumNumberOfTouches, 2);
1029
+ XCTestExpectation *hold = [self expectationWithDescription:@"root stationary finger held"];
1030
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.25 * NSEC_PER_SEC)),
1031
+ dispatch_get_main_queue(), ^{ [hold fulfill]; });
1032
+ [self waitForExpectations:@[hold] timeout:2];
1033
+ NSLog(@"[PagerPressDelivery] rootLongPress begins=%lu state=%ld touchPhase=%ld guardState=%ld pagerPanMinTouches=%lu",
1034
+ (unsigned long)self.longPressBegins, (long)longPress.state, (long)touch.phase,
1035
+ (long)guard.state, (unsigned long)pager.panGestureRecognizer.minimumNumberOfTouches);
1036
+ // The UIKit target action must arrive before the real window receives UP.
1037
+ XCTAssertEqual(self.longPressBegins, 1);
1038
+ XCTAssertEqual(touch.phase, UITouchPhaseBegan);
1039
+ XCTAssertEqual(guard.state, UIGestureRecognizerStatePossible);
1040
+ XCTAssertEqual(pager.panGestureRecognizer.minimumNumberOfTouches, 2);
1041
+ [self.driver end:touch];
1042
+ XCTAssertEqual(pager.panGestureRecognizer.minimumNumberOfTouches, 1);
1043
+ }
1044
+
1014
1045
  - (void)testNestedStationaryNativeLongPressRecognizesBeforeFingerUp
1015
1046
  {
1016
1047
  UIScrollView *scroll = [self mountNestedHorizontalScrollView];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/react-native-pager-view",
3
- "version": "3.0.169",
3
+ "version": "3.0.170",
4
4
  "description": "React Native wrapper for Android and iOS ViewPager",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/module/index.js",
@@ -72,7 +72,7 @@
72
72
  "typescript": "^5.9.2"
73
73
  },
74
74
  "peerDependencies": {
75
- "@onekeyfe/react-native-native-logger": "3.0.169",
75
+ "@onekeyfe/react-native-native-logger": "3.0.170",
76
76
  "react": "*",
77
77
  "react-native": "*"
78
78
  },