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 @@ -157,6 +157,16 @@ }; const [scrollBlockingModalStatus, setScrollBlockingModalStatus] = React.useState(() => getScrollBlockingModalStatus(scenes)); + + const resetScrollBlockingModalStatus = React.useCallback(() => { + if (!prevScenesRef.current) { + return; + } + setScrollBlockingModalStatus( + getScrollBlockingModalStatus(prevScenesRef.current), + ); + }, []); + const sceneDataForNewScene = scene => ({ ...scene, context: { @@ -164,6 +174,7 @@ visibleOverlays, scrollBlockingModalStatus, setScrollBlockingModalStatus, + resetScrollBlockingModalStatus, }, ordering: { ...scene.ordering,