Skip to content

Commit

Permalink
🐞 Fix: Modal Native Events
Browse files Browse the repository at this point in the history
Update RNIModalView.swift
  • Loading branch information
dominicstop committed Apr 16, 2023
1 parent b67d841 commit 090f241
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
32 changes: 16 additions & 16 deletions ios/src_library/React Native/RNIModalView/RNIModalView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,27 +66,27 @@ public class RNIModalView:
// MARK: - Properties: React Props - Events
// ----------------------------------------

var onModalWillPresent: RCTBubblingEventBlock?;
var onModalDidPresent: RCTBubblingEventBlock?;
@objc var onModalWillPresent: RCTBubblingEventBlock?;
@objc var onModalDidPresent: RCTBubblingEventBlock?;

var onModalWillDismiss: RCTBubblingEventBlock?;
var onModalDidDismiss: RCTBubblingEventBlock?;
@objc var onModalWillDismiss: RCTBubblingEventBlock?;
@objc var onModalDidDismiss: RCTBubblingEventBlock?;

var onModalWillShow: RCTBubblingEventBlock?;
var onModalDidShow: RCTBubblingEventBlock?;
@objc var onModalWillShow: RCTBubblingEventBlock?;
@objc var onModalDidShow: RCTBubblingEventBlock?;

var onModalWillHide: RCTBubblingEventBlock?;
var onModalDidHide: RCTBubblingEventBlock?;
@objc var onModalWillHide: RCTBubblingEventBlock?;
@objc var onModalDidHide: RCTBubblingEventBlock?;

var onModalWillFocus: RCTBubblingEventBlock?;
var onModalDidFocus: RCTBubblingEventBlock?;
@objc var onModalWillFocus: RCTBubblingEventBlock?;
@objc var onModalDidFocus: RCTBubblingEventBlock?;

var onModalWillBlur: RCTBubblingEventBlock?;
var onModalDidBlur: RCTBubblingEventBlock?;
@objc var onModalWillBlur: RCTBubblingEventBlock?;
@objc var onModalDidBlur: RCTBubblingEventBlock?;

var onPresentationControllerWillDismiss: RCTBubblingEventBlock?;
var onPresentationControllerDidDismiss: RCTBubblingEventBlock?;
var onPresentationControllerDidAttemptToDismiss: RCTBubblingEventBlock?;
@objc var onPresentationControllerWillDismiss: RCTBubblingEventBlock?;
@objc var onPresentationControllerDidDismiss: RCTBubblingEventBlock?;
@objc var onPresentationControllerDidAttemptToDismiss: RCTBubblingEventBlock?;

// MARK: - Properties: React Props - Value
// ---------------------------------------
Expand Down Expand Up @@ -957,7 +957,7 @@ extension RNIModalView: RNIModalFocusNotifiable {
isInitial: sender === self
);

self.onModalDidFocus?(
self.onModalDidBlur?(
eventData.synthesizedJSDictionary
);

Expand Down
30 changes: 15 additions & 15 deletions ios/src_library/React Native/RNIModalView/RNIModalViewManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@ @interface RCT_EXTERN_MODULE(RNIModalViewManager, RCTViewManager)
// MARK: Props - Callbacks/Events
// ------------------------------

RCT_EXPORT_VIEW_PROPERTY(onModalWillPresent, RCTDirectEventBlock);
RCT_EXPORT_VIEW_PROPERTY(onModalDidPresent, RCTDirectEventBlock);
RCT_EXPORT_VIEW_PROPERTY(onModalWillPresent, RCTBubblingEventBlock);
RCT_EXPORT_VIEW_PROPERTY(onModalDidPresent, RCTBubblingEventBlock);

RCT_EXPORT_VIEW_PROPERTY(onModalWillDismiss, RCTDirectEventBlock);
RCT_EXPORT_VIEW_PROPERTY(onModalDidDismiss, RCTDirectEventBlock);
RCT_EXPORT_VIEW_PROPERTY(onModalWillDismiss, RCTBubblingEventBlock);
RCT_EXPORT_VIEW_PROPERTY(onModalDidDismiss, RCTBubblingEventBlock);

RCT_EXPORT_VIEW_PROPERTY(onModalWillShow, RCTDirectEventBlock);
RCT_EXPORT_VIEW_PROPERTY(onModalDidShow, RCTDirectEventBlock);
RCT_EXPORT_VIEW_PROPERTY(onModalWillShow, RCTBubblingEventBlock);
RCT_EXPORT_VIEW_PROPERTY(onModalDidShow, RCTBubblingEventBlock);

RCT_EXPORT_VIEW_PROPERTY(onModalWillHide, RCTDirectEventBlock);
RCT_EXPORT_VIEW_PROPERTY(onModalDidHide, RCTDirectEventBlock);
RCT_EXPORT_VIEW_PROPERTY(onModalWillHide, RCTBubblingEventBlock);
RCT_EXPORT_VIEW_PROPERTY(onModalDidHide, RCTBubblingEventBlock);

RCT_EXPORT_VIEW_PROPERTY(onModalWillFocus, RCTDirectEventBlock);
RCT_EXPORT_VIEW_PROPERTY(onModalDidFocus, RCTDirectEventBlock);
RCT_EXPORT_VIEW_PROPERTY(onModalWillFocus, RCTBubblingEventBlock);
RCT_EXPORT_VIEW_PROPERTY(onModalDidFocus, RCTBubblingEventBlock);

RCT_EXPORT_VIEW_PROPERTY(onModalWillBlur, RCTDirectEventBlock)
RCT_EXPORT_VIEW_PROPERTY(onModalDidBlur, RCTDirectEventBlock)
RCT_EXPORT_VIEW_PROPERTY(onModalWillBlur, RCTBubblingEventBlock)
RCT_EXPORT_VIEW_PROPERTY(onModalDidBlur, RCTBubblingEventBlock)

RCT_EXPORT_VIEW_PROPERTY(onPresentationControllerWillDismiss, RCTDirectEventBlock)
RCT_EXPORT_VIEW_PROPERTY(onPresentationControllerDidDismiss, RCTDirectEventBlock)
RCT_EXPORT_VIEW_PROPERTY(onPresentationControllerDidAttemptToDismiss, RCTDirectEventBlock);
RCT_EXPORT_VIEW_PROPERTY(onPresentationControllerWillDismiss, RCTBubblingEventBlock)
RCT_EXPORT_VIEW_PROPERTY(onPresentationControllerDidDismiss, RCTBubblingEventBlock)
RCT_EXPORT_VIEW_PROPERTY(onPresentationControllerDidAttemptToDismiss, RCTBubblingEventBlock);

// --------------------------------
// MARK: Props - RN Component Props
Expand Down

0 comments on commit 090f241

Please sign in to comment.