Skip to content

Commit a6452f8

Browse files
committed
sendDragEvent -> emitDragEvent
1 parent 3f45e98 commit a6452f8

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,11 +1767,14 @@ - (void)buildDataTransferItems:(std::vector<DataTransferItem> &)dataTransferItem
17671767
}
17681768
}
17691769

1770-
- (void)sendDragEvent:(DragEventType)eventType withLocation:(NSPoint)locationInWindow pasteboard:(NSPasteboard *)pasteboard {
1770+
- (void)emitDragEvent:(DragEventType)eventType draggingInfo:(id<NSDraggingInfo>)sender {
17711771
if (!_eventEmitter) {
17721772
return;
17731773
}
17741774

1775+
NSPoint locationInWindow = sender.draggingLocation;
1776+
NSPasteboard *pasteboard = sender.draggingPasteboard;
1777+
17751778
std::vector<DataTransferItem> dataTransferItems{};
17761779
[self buildDataTransferItems:dataTransferItems forPasteboard:pasteboard];
17771780

@@ -1812,7 +1815,7 @@ - (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
18121815
NSPasteboard *pboard = sender.draggingPasteboard;
18131816
NSDragOperation sourceDragMask = sender.draggingSourceOperationMask;
18141817

1815-
[self sendDragEvent:DragEnter withLocation:sender.draggingLocation pasteboard:pboard];
1818+
[self emitDragEvent:DragEnter draggingInfo:sender];
18161819

18171820
if ([pboard availableTypeFromArray:self.registeredDraggedTypes]) {
18181821
if (sourceDragMask & NSDragOperationLink) {
@@ -1826,12 +1829,12 @@ - (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
18261829

18271830
- (void)draggingExited:(id<NSDraggingInfo>)sender
18281831
{
1829-
[self sendDragEvent:DragLeave withLocation:sender.draggingLocation pasteboard:sender.draggingPasteboard];
1832+
[self emitDragEvent:DragLeave draggingInfo:sender];
18301833
}
18311834

18321835
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
18331836
{
1834-
[self sendDragEvent:Drop withLocation:sender.draggingLocation pasteboard:sender.draggingPasteboard];
1837+
[self emitDragEvent:Drop draggingInfo:sender];
18351838
return YES;
18361839
}
18371840

0 commit comments

Comments
 (0)