Skip to content

Commit

Permalink
[fabric][touch-handler] Remove cancelTouchWithEvent till surface to…
Browse files Browse the repository at this point in the history
…uch handler is merged
  • Loading branch information
shwanton authored and Saadnajmi committed Nov 20, 2024
1 parent 8f136b9 commit c2cfc89
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

#if !TARGET_OS_OSX // [macOS]
#import <MobileCoreServices/UTCoreTypes.h>
#else // [macOS
#import <React/RCTSurfaceTouchHandler.h>
#endif // macOS]

#import <react/renderer/components/text/ParagraphComponentDescriptor.h>
Expand Down Expand Up @@ -58,7 +56,10 @@ @interface RCTParagraphComponentView () <UIEditMenuInteractionDelegate>
@property (nonatomic, nullable) UIEditMenuInteraction *editMenuInteraction API_AVAILABLE(ios(16.0));

@end
#endif // [macOS]
#else // [macOS
@interface RCTParagraphComponentView () <NSTextViewDelegate>
@end
#endif // macOS]

@implementation RCTParagraphComponentView {
ParagraphShadowNode::ConcreteState::Shared _state;
Expand Down Expand Up @@ -348,6 +349,8 @@ - (void)mouseDown:(NSEvent *)event
if (!_textView.selectable) {
[super mouseDown:event];
return;
} else {
NSLog(@"not selectable");
}

// Double/triple-clicks should be forwarded to the NSTextView.
Expand All @@ -369,7 +372,6 @@ - (void)mouseDown:(NSEvent *)event

// Start selection if we're still selectable and hit-testable.
if (_textView.selectable && [contentView hitTest:point] == self) {
[[RCTSurfaceTouchHandler surfaceTouchHandlerForView:self] cancelTouchWithEvent:event];
[self.window makeFirstResponder:_textView];
[_textView mouseDown:event];
}
Expand Down

0 comments on commit c2cfc89

Please sign in to comment.