Skip to content

Commit

Permalink
⭐️ Impl: OnModalFocusChangeEventPayload.modalLevel
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicstop committed Oct 2, 2024
1 parent e54cfd0 commit b888791
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ios/RNIModalSheetView/RNIModalSheetViewDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -480,11 +480,17 @@ extension RNIModalSheetViewDelegate: ModalFocusEventNotifiable {
currentState: ModalFocusState,
nextState: ModalFocusState
) {

let modalLevel =
viewController.modalRegistryEntry?.modalFocusIndex
?? viewController.modalLevel
?? -1;

var payload: Dictionary<String, Any> = [
"viewControllerInstanceID": viewController.synthesizedStringID,
"currentState": currentState.rawValue,
"nextState": nextState.rawValue,
"modalLevel": modalLevel,
];

payload.unwrapAndMerge(withOther: [
Expand Down
1 change: 1 addition & 0 deletions src/types/CommonModalEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export type OnModalDidHideEventPayload = Readonly<{

export type OnModalFocusChangeEventPayload = Readonly<{
viewControllerInstanceID: string;
modalLevel: number;
prevState?: ModalFocusState;
currentState: ModalFocusState;
nextState: ModalFocusState;
Expand Down

0 comments on commit b888791

Please sign in to comment.