From 40aee070f93b1f2597a86c3b408ca7f86efed09e Mon Sep 17 00:00:00 2001 From: Rob Jonson Date: Mon, 7 Sep 2020 11:10:11 +0100 Subject: [PATCH] check for Touch event before closing menu --- Sources/iOS/FABMenu/FABMenu.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Sources/iOS/FABMenu/FABMenu.swift b/Sources/iOS/FABMenu/FABMenu.swift index fa115c258..841947aea 100644 --- a/Sources/iOS/FABMenu/FABMenu.swift +++ b/Sources/iOS/FABMenu/FABMenu.swift @@ -457,7 +457,10 @@ extension FABMenu { - Returns: An optional UIView. */ open override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? { - guard isOpened, isEnabled else { + + //under Catalyst, the FabMenu is hit with UIHover events. + //If we don't check that the event is a touch, the menu is prematurely closed + guard isOpened, isEnabled, event?.type == .touches else { return super.hitTest(point, with: event) }