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, @@ -171,6 +173,7 @@ ) => Promise, +navigation: ?ChatNavigationProp<'MessageList'>, +isFocused?: boolean, + +overlayContext: ?OverlayContextType, }; type State = { +text: string, @@ -895,7 +898,9 @@ unblockAndDispatch(); return; } - exitEditAlert(unblockAndDispatch); + exitEditAlert(unblockAndDispatch, () => { + this.props.overlayContext?.setScrollBlockingModalStatus('closed'); + }); }; blockNavigation = () => { @@ -1223,6 +1228,7 @@ getDefaultTextMessageRules().simpleMarkdownRules, ); const editMessage = useEditMessage(); + const overlayContext = React.useContext(OverlayContext); return ( ); } diff --git a/native/utils/edit-messages-utils.js b/native/utils/edit-messages-utils.js --- a/native/utils/edit-messages-utils.js +++ b/native/utils/edit-messages-utils.js @@ -2,7 +2,7 @@ import Alert from 'react-native/Libraries/Alert/Alert.js'; -function exitEditAlert(onDiscard: () => void): void { +function exitEditAlert(onDiscard: () => void, onPress: ?() => void): void { Alert.alert( 'Discard changes?', 'You have unsaved changes which will be discarded if you navigate away.', @@ -10,13 +10,12 @@ { text: 'Continue editing', style: 'cancel', + onPress: onPress, }, { text: 'Discard edit', style: 'destructive', - onPress: () => { - onDiscard(); - }, + onPress: onDiscard, }, ], );