Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -563,36 +563,42 @@ - (void)grammarCheckingDidChange:(BOOL)enabled
}
}

- (BOOL)hasValidKeyDownOrValidKeyUp:(nonnull NSString *)key {
return YES;
}

- (void)submitOnKeyDownIfNeeded:(nonnull NSEvent *)event {}

- (void)textInputDidCancel {}

- (NSDragOperation)textInputDraggingEntered:(nonnull id<NSDraggingInfo>)draggingInfo {
if ([draggingInfo.draggingPasteboard availableTypeFromArray:self.registeredDraggedTypes]) {
return [self draggingEntered:draggingInfo];
}
return NSDragOperationNone;
}

- (void)textInputDraggingExited:(nonnull id<NSDraggingInfo>)draggingInfo {
return;
if ([draggingInfo.draggingPasteboard availableTypeFromArray:self.registeredDraggedTypes]) {
[self draggingExited:draggingInfo];
}
}

- (BOOL)textInputShouldHandleDeleteBackward:(nonnull id<RCTBackedTextInputViewProtocol>)sender {
- (BOOL)textInputShouldHandleDragOperation:(nonnull id<NSDraggingInfo>)draggingInfo {
if ([draggingInfo.draggingPasteboard availableTypeFromArray:self.registeredDraggedTypes]) {
[self performDragOperation:draggingInfo];
return NO;
}

return YES;
}

- (BOOL)textInputShouldHandleDeleteForward:(nonnull id<RCTBackedTextInputViewProtocol>)sender {
- (BOOL)textInputShouldHandleDeleteBackward:(nonnull id<RCTBackedTextInputViewProtocol>)sender {
return YES;
}

- (BOOL)textInputShouldHandleDragOperation:(nonnull id<NSDraggingInfo>)draggingInfo {
- (BOOL)textInputShouldHandleDeleteForward:(nonnull id<RCTBackedTextInputViewProtocol>)sender {
return YES;
}

- (BOOL)textInputShouldHandleKeyEvent:(nonnull NSEvent *)event {
return YES;
return ![self handleKeyboardEvent:event];
}

- (BOOL)textInputShouldHandlePaste:(nonnull id<RCTBackedTextInputViewProtocol>)sender {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
#import <react/renderer/core/LayoutMetrics.h>
#import <react/renderer/core/Props.h>

#if TARGET_OS_OSX // [macOS
#include <react/renderer/components/view/MouseEvent.h>
#endif // macOS]

NS_ASSUME_NONNULL_BEGIN

/**
Expand Down Expand Up @@ -79,6 +83,11 @@ NS_ASSUME_NONNULL_BEGIN
- (void)finalizeUpdates:(RNComponentViewUpdateMask)updateMask NS_REQUIRES_SUPER;
- (void)prepareForRecycle NS_REQUIRES_SUPER;

#if TARGET_OS_OSX // [macOS
- (BOOL)handleKeyboardEvent:(NSEvent *)event;
- (void)buildDataTransferItems:(std::vector<facebook::react::DataTransferItem> &)dataTransferItems forPasteboard:(NSPasteboard *)pasteboard;
#endif // macOS]

/*
* This is a fragment of temporary workaround that we need only temporary and will get rid of soon.
*/
Expand Down
Loading
Loading