diff --git a/native/chat/chat-input-bar.react.js b/native/chat/chat-input-bar.react.js --- a/native/chat/chat-input-bar.react.js +++ b/native/chat/chat-input-bar.react.js @@ -111,6 +111,8 @@ activeThreadSelector, } from '../navigation/nav-selectors.js'; import { NavContext } from '../navigation/navigation-context.js'; +import { OverlayContext } from '../navigation/overlay-context.js'; +import type { OverlayContextType } from '../navigation/overlay-context.js'; import { type NavigationRoute, ChatCameraModalRouteName, @@ -170,6 +172,7 @@ text: string, ) => Promise, +navigation: ?ChatNavigationProp<'MessageList'>, + +overlayContext: ?OverlayContextType, }; type State = { +text: string, @@ -901,8 +904,12 @@ this.unblockNavigation(); navigation.dispatch(action); }; + const onContinueEditing = () => { + this.props.overlayContext?.resetScrollBlockingModalStatus(); + }; exitEditAlert({ onDiscard: unblockAndDispatch, + onContinueEditing, }); return 'ignore_action'; }; @@ -1197,6 +1204,7 @@ const navContext = React.useContext(NavContext); const keyboardState = React.useContext(KeyboardContext); const inputState = React.useContext(InputStateContext); + const overlayContext = React.useContext(OverlayContext); const viewerID = useSelector( state => state.currentUserInfo && state.currentUserInfo.id, @@ -1276,6 +1284,7 @@ editedMessageInfo={editedMessageInfo} editMessage={editMessage} navigation={props.navigation} + overlayContext={overlayContext} /> ); } diff --git a/native/navigation/overlay-context.js b/native/navigation/overlay-context.js --- a/native/navigation/overlay-context.js +++ b/native/navigation/overlay-context.js @@ -17,6 +17,7 @@ }>, +scrollBlockingModalStatus: ScrollBlockingModalStatus, +setScrollBlockingModalStatus: ScrollBlockingModalStatus => void, + +resetScrollBlockingModalStatus: () => void, }; const OverlayContext: React.Context = React.createContext(null); diff --git a/native/navigation/overlay-navigator.react.js b/native/navigation/overlay-navigator.react.js --- a/native/navigation/overlay-navigator.react.js +++ b/native/navigation/overlay-navigator.react.js @@ -17,6 +17,7 @@ } from '@react-navigation/native'; import { TransitionPresets } from '@react-navigation/stack'; import invariant from 'invariant'; +import _values from 'lodash/values.js'; import * as React from 'react'; import { View, StyleSheet } from 'react-native'; import Animated, { EasingNode } from 'react-native-reanimated'; @@ -157,6 +158,13 @@ }; const [scrollBlockingModalStatus, setScrollBlockingModalStatus] = React.useState(() => getScrollBlockingModalStatus(scenes)); + + const resetScrollBlockingModalStatus = React.useCallback(() => { + setScrollBlockingModalStatus( + getScrollBlockingModalStatus(_values(prevSceneDataRef.current)), + ); + }, []); + const sceneDataForNewScene = scene => ({ ...scene, context: { @@ -164,6 +172,7 @@ visibleOverlays, scrollBlockingModalStatus, setScrollBlockingModalStatus, + resetScrollBlockingModalStatus, }, ordering: { ...scene.ordering,