Skip to content

Commit 6c14ecf

Browse files
committed
fix: KCV onLayout issue
1 parent e261d00 commit 6c14ecf

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

examples/ExpoMessaging/app.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@
101101
}
102102
}
103103
],
104-
"./plugins/keyboardInsetMainActivityListener.js",
105104
"./plugins/opSqliteSwiftPlugin.js",
106105
"expo-sharing"
107106
]

examples/ExpoMessaging/app/channel/[cid]/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { AppContext } from '../../../context/AppContext';
1313
import { useHeaderHeight } from '@react-navigation/elements';
1414
import InputButtons from '../../../components/InputButtons';
1515
import { MessageLocation } from '../../../components/LocationSharing/MessageLocation';
16-
import { Platform, StyleSheet, View } from 'react-native';
16+
import { StyleSheet, View } from 'react-native';
1717

1818
export default function ChannelScreen() {
1919
const { client } = useChatContext();
@@ -74,7 +74,7 @@ export default function ChannelScreen() {
7474
audioRecordingEnabled={true}
7575
channel={channel}
7676
onPressMessage={onPressMessage}
77-
keyboardVerticalOffset={Platform.OS === 'ios' ? headerHeight : undefined}
77+
keyboardVerticalOffset={headerHeight}
7878
MessageLocation={MessageLocation}
7979
thread={thread}
8080
>

package/src/components/UIComponents/PortalWhileClosingView.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
setClosingPortalLayout,
1313
useShouldTeleportToClosingPortal,
1414
useHasActiveId,
15+
useIsOverlayClosing,
1516
} from '../../state-store';
1617

1718
type PortalWhileClosingViewProps = {
@@ -116,9 +117,10 @@ const useSyncingApi = (portalHostName: string, registrationId: string) => {
116117
const placeholderLayout = useSharedValue({ h: 0, w: 0 });
117118
const insets = useSafeAreaInsets();
118119
const hasActiveId = useHasActiveId();
120+
const isClosing = useIsOverlayClosing();
119121

120122
const syncPortalLayout = useStableCallback(() => {
121-
if (!hasActiveId) {
123+
if (!hasActiveId && !isClosing) {
122124
return;
123125
}
124126

@@ -143,10 +145,10 @@ const useSyncingApi = (portalHostName: string, registrationId: string) => {
143145
});
144146

145147
useEffect(() => {
146-
if (hasActiveId) {
148+
if (hasActiveId || isClosing) {
147149
syncPortalLayout();
148150
}
149-
}, [insets.bottom, hasActiveId, syncPortalLayout]);
151+
}, [insets.bottom, isClosing, hasActiveId, syncPortalLayout]);
150152

151153
return useMemo(
152154
() => ({ syncPortalLayout, containerRef, placeholderLayout }),

0 commit comments

Comments
 (0)