From d42abe8f14cfdd9e4e7e6d04128218847a73c128 Mon Sep 17 00:00:00 2001 From: Situ Chandra Shil <108292595+situchan@users.noreply.github.com> Date: Tue, 30 Sep 2025 21:12:08 +1000 Subject: [PATCH] Revert "Fix/70912 - Edit composer isn't automatically focused" --- src/components/Modal/ReanimatedModal/index.tsx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/components/Modal/ReanimatedModal/index.tsx b/src/components/Modal/ReanimatedModal/index.tsx index 5ac1d15dc59a..3d412445cde3 100644 --- a/src/components/Modal/ReanimatedModal/index.tsx +++ b/src/components/Modal/ReanimatedModal/index.tsx @@ -145,13 +145,13 @@ function ReanimatedModal({ if (handleRef.current) { InteractionManager.clearInteractionHandle(handleRef.current); } - // On the web platform, the Modal's onDismiss callback may not be triggered if the dismiss process is interrupted by other actions such as navigation. - // Specifically on Android, the Modal's onDismiss callback does not work reliably. There's a reported issue at: + // Because on Android, the Modal's onDismiss callback does not work reliably. There's a reported issue at: // https://stackoverflow.com/questions/58937956/react-native-modal-ondismiss-not-invoked - // Therefore, we manually call onDismiss and onModalHide here. - onDismiss?.(); - onModalHide(); - }, [onDismiss, onModalHide]); + // Therefore, we manually call onModalHide() here for Android. + if (getPlatform() === CONST.PLATFORM.ANDROID) { + onModalHide(); + } + }, [onModalHide]); const containerView = ( { + onDismiss?.(); + if (getPlatform() !== CONST.PLATFORM.ANDROID) { + onModalHide(); + } + }} // eslint-disable-next-line react/jsx-props-no-spreading {...props} >