Skip to content

Commit

Permalink
Refactor PointerEvent emitting into its own gesture recognizer
Browse files Browse the repository at this point in the history
Summary:
Changelog: [iOS][Internal] - Refactor PointerEvent emitting into its own gesture recognizer

In doing some exploration of a full e2e implementation of the click event I found pretty early on the necessity of addressing the pointerCancel on scroll functionality which, to implement properly without degrading the existing touch gesture handler — involves extracting all the pointer event handling code written so far into its own gesture handler so it can "fail" (when a scroll view wants to take priority) without affecting the existing touch handlers.

This diff is only a refactor and doesn't add/change any new functionality.

allow-large-files

Reviewed By: sammy-SC

Differential Revision: D43372806

fbshipit-source-id: e16f75121fd121d3f82ab43cfc6fab0629654f26
  • Loading branch information
vincentriemer authored and OlimpiaZurek committed May 22, 2023
1 parent 96a75b0 commit 3ba5392
Show file tree
Hide file tree
Showing 5 changed files with 965 additions and 623 deletions.
28 changes: 28 additions & 0 deletions React/Fabric/RCTSurfacePointerHandler.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface RCTSurfacePointerHandler : UIGestureRecognizer

/*
* Attaches (and detaches) a view to the touch handler.
* The receiver does not retain the provided view.
*/
- (void)attachToView:(UIView *)view;
- (void)detachFromView:(UIView *)view;

/*
* Offset of the attached view relative to the root component in points.
*/
@property (nonatomic, assign) CGPoint viewOriginOffset;

@end

NS_ASSUME_NONNULL_END
Loading

0 comments on commit 3ba5392

Please sign in to comment.