diff --git a/ios/RNIModalSheetView/RNIModalSheetStateMetrics.swift b/ios/RNIModalSheetView/RNIModalSheetStateMetrics.swift index 48a62842..cc140e99 100644 --- a/ios/RNIModalSheetView/RNIModalSheetStateMetrics.swift +++ b/ios/RNIModalSheetView/RNIModalSheetStateMetrics.swift @@ -17,6 +17,7 @@ public struct RNIModalSheetStateMetrics: DictionaryRepresentationSynthesizing { public var isPresented: Bool; public var isDismissing: Bool; public var isDismissed: Bool; + public var isIdle: Bool; public init( state: ModalSheetState, @@ -24,7 +25,8 @@ public struct RNIModalSheetStateMetrics: DictionaryRepresentationSynthesizing { isPresenting: Bool, isPresented: Bool, isDismissing: Bool, - isDismissed: Bool + isDismissed: Bool, + isIdle: Bool ) { self.state = state; self.simplified = simplified; @@ -32,6 +34,7 @@ public struct RNIModalSheetStateMetrics: DictionaryRepresentationSynthesizing { self.isPresented = isPresented; self.isDismissing = isDismissing; self.isDismissed = isDismissed; + self.isIdle = isIdle; }; public init(fromModalSheetState state: ModalSheetState){ @@ -41,5 +44,6 @@ public struct RNIModalSheetStateMetrics: DictionaryRepresentationSynthesizing { self.isPresented = state.isPresented; self.isDismissing = state.isDismissing; self.isDismissed = state.isDismissed; + self.isIdle = state.isIdle; }; }; diff --git a/ios/Temp/ModalSheetState.swift b/ios/Temp/ModalSheetState.swift index e1d572cb..d7111f78 100644 --- a/ios/Temp/ModalSheetState.swift +++ b/ios/Temp/ModalSheetState.swift @@ -16,6 +16,8 @@ public enum ModalSheetState: String { case presented; case dismissViaGestureCancelled; + case draggingViaGesture; + case dismissing; case dismissingViaGesture; case presentingViaGestureCanceling; @@ -35,7 +37,7 @@ public enum ModalSheetState: String { case .presented, .dismissViaGestureCancelled: return .presented; - case .dismissing, .dismissingViaGesture, .presentingViaGestureCanceling: + case .dismissing, .dismissingViaGesture, .presentingViaGestureCanceling, .draggingViaGesture: return .dismissing; case .dismissed, .dismissedViaGesture, .presentingViaGestureCancelled: @@ -59,6 +61,16 @@ public enum ModalSheetState: String { self.modalState.isDismissed; }; + public var isIdle: Bool { + switch self { + case .draggingViaGesture: + return false; + + default: + return self.modalState.isIdle; + }; + }; + public var simplified: Self { self.modalState.modalSheetState; }; diff --git a/ios/Temp/ModalState.swift b/ios/Temp/ModalState.swift index 86332b71..8b8fc3e3 100644 --- a/ios/Temp/ModalState.swift +++ b/ios/Temp/ModalState.swift @@ -34,6 +34,16 @@ public enum ModalState: String { self == .dismissed; }; + public var isIdle: Bool { + switch self { + case .presenting, .dismissing: + return false; + + default: + return true; + }; + }; + public var modalSheetState: ModalSheetState { switch self { case .presenting: diff --git a/src/types/RNIModalSheetStateMetrics.ts b/src/types/RNIModalSheetStateMetrics.ts index 8bc7f6fb..49978ec5 100644 --- a/src/types/RNIModalSheetStateMetrics.ts +++ b/src/types/RNIModalSheetStateMetrics.ts @@ -9,4 +9,5 @@ export type RNIModalSheetStateMetrics = { isPresented: boolean; isDismissing: boolean; isDismissed: boolean; + isIdle: boolean; }; \ No newline at end of file