Page MenuHomePhabricator

D8271.diff
No OneTemporary

D8271.diff

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<SendEditMessageResponse>,
+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<?OverlayContextType> =
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,13 @@
};
const [scrollBlockingModalStatus, setScrollBlockingModalStatus] =
React.useState(() => getScrollBlockingModalStatus(scenes));
+
+ const resetScrollBlockingModalStatus = React.useCallback(() => {
+ setScrollBlockingModalStatus(
+ getScrollBlockingModalStatus(prevScenesRef.current ?? []),
+ );
+ }, []);
+
const sceneDataForNewScene = scene => ({
...scene,
context: {
@@ -164,6 +171,7 @@
visibleOverlays,
scrollBlockingModalStatus,
setScrollBlockingModalStatus,
+ resetScrollBlockingModalStatus,
},
ordering: {
...scene.ordering,

File Metadata

Mime Type
text/plain
Expires
Wed, Dec 4, 12:50 PM (9 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2614293
Default Alt Text
D8271.diff (2 KB)

Event Timeline