From 6c14ecf51ed6c921f2e272b6fc2159d870f041ff Mon Sep 17 00:00:00 2001 From: Ivan Sekovanikj Date: Fri, 3 Apr 2026 23:51:02 +0200 Subject: [PATCH] fix: KCV onLayout issue --- examples/ExpoMessaging/app.json | 1 - examples/ExpoMessaging/app/channel/[cid]/index.tsx | 4 ++-- .../components/UIComponents/PortalWhileClosingView.tsx | 8 +++++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/ExpoMessaging/app.json b/examples/ExpoMessaging/app.json index af03d07c37..7783e55edf 100644 --- a/examples/ExpoMessaging/app.json +++ b/examples/ExpoMessaging/app.json @@ -101,7 +101,6 @@ } } ], - "./plugins/keyboardInsetMainActivityListener.js", "./plugins/opSqliteSwiftPlugin.js", "expo-sharing" ] diff --git a/examples/ExpoMessaging/app/channel/[cid]/index.tsx b/examples/ExpoMessaging/app/channel/[cid]/index.tsx index e621096c42..e3e5a8de94 100644 --- a/examples/ExpoMessaging/app/channel/[cid]/index.tsx +++ b/examples/ExpoMessaging/app/channel/[cid]/index.tsx @@ -13,7 +13,7 @@ import { AppContext } from '../../../context/AppContext'; import { useHeaderHeight } from '@react-navigation/elements'; import InputButtons from '../../../components/InputButtons'; import { MessageLocation } from '../../../components/LocationSharing/MessageLocation'; -import { Platform, StyleSheet, View } from 'react-native'; +import { StyleSheet, View } from 'react-native'; export default function ChannelScreen() { const { client } = useChatContext(); @@ -74,7 +74,7 @@ export default function ChannelScreen() { audioRecordingEnabled={true} channel={channel} onPressMessage={onPressMessage} - keyboardVerticalOffset={Platform.OS === 'ios' ? headerHeight : undefined} + keyboardVerticalOffset={headerHeight} MessageLocation={MessageLocation} thread={thread} > diff --git a/package/src/components/UIComponents/PortalWhileClosingView.tsx b/package/src/components/UIComponents/PortalWhileClosingView.tsx index 5e5b2c82e3..ffe785a004 100644 --- a/package/src/components/UIComponents/PortalWhileClosingView.tsx +++ b/package/src/components/UIComponents/PortalWhileClosingView.tsx @@ -12,6 +12,7 @@ import { setClosingPortalLayout, useShouldTeleportToClosingPortal, useHasActiveId, + useIsOverlayClosing, } from '../../state-store'; type PortalWhileClosingViewProps = { @@ -116,9 +117,10 @@ const useSyncingApi = (portalHostName: string, registrationId: string) => { const placeholderLayout = useSharedValue({ h: 0, w: 0 }); const insets = useSafeAreaInsets(); const hasActiveId = useHasActiveId(); + const isClosing = useIsOverlayClosing(); const syncPortalLayout = useStableCallback(() => { - if (!hasActiveId) { + if (!hasActiveId && !isClosing) { return; } @@ -143,10 +145,10 @@ const useSyncingApi = (portalHostName: string, registrationId: string) => { }); useEffect(() => { - if (hasActiveId) { + if (hasActiveId || isClosing) { syncPortalLayout(); } - }, [insets.bottom, hasActiveId, syncPortalLayout]); + }, [insets.bottom, isClosing, hasActiveId, syncPortalLayout]); return useMemo( () => ({ syncPortalLayout, containerRef, placeholderLayout }),