about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2024-12-18 16:22:16 -0600
committerGitHub <noreply@github.com>2024-12-18 22:22:16 +0000
commit925a240ec4fe6de41a0716c0cb1e222e4d2b89c7 (patch)
tree32d0dd42d8c8a024825c28d1df5893cf4ba45a43
parent62daf047ca1f6d6529fe3196c11de97fdf8fd702 (diff)
downloadvoidsky-925a240ec4fe6de41a0716c0cb1e222e4d2b89c7.tar.zst
Fork close logic for android to match previous usage (#7165)
-rw-r--r--src/components/Menu/index.tsx18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/components/Menu/index.tsx b/src/components/Menu/index.tsx
index f4f33235a..99fb2d127 100644
--- a/src/components/Menu/index.tsx
+++ b/src/components/Menu/index.tsx
@@ -4,7 +4,7 @@ import {msg, Trans} from '@lingui/macro'
 import {useLingui} from '@lingui/react'
 import flattenReactChildren from 'react-keyed-flatten-children'
 
-import {isNative} from '#/platform/detection'
+import {isAndroid, isIOS, isNative} from '#/platform/detection'
 import {atoms as a, useTheme} from '#/alf'
 import {Button, ButtonText} from '#/components/Button'
 import * as Dialog from '#/components/Dialog'
@@ -122,9 +122,21 @@ export function Item({children, label, style, onPress, ...rest}: ItemProps) {
       onFocus={onFocus}
       onBlur={onBlur}
       onPress={async e => {
-        context.control.close(() => {
+        if (isAndroid) {
+          /**
+           * Below fix for iOS doesn't work for Android, this does.
+           */
           onPress?.(e)
-        })
+          context.control.close()
+        } else if (isIOS) {
+          /**
+           * Fixes a subtle bug on iOS
+           * {@link https://github.com/bluesky-social/social-app/pull/5849/files#diff-de516ef5e7bd9840cd639213301df38cf03acfcad5bda85a1d63efd249ba79deL124-L127}
+           */
+          context.control.close(() => {
+            onPress?.(e)
+          })
+        }
       }}
       onPressIn={e => {
         onPressIn()