Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3406568
D8271.id28609.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D8271.id28609.diff
View Options
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
@@ -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,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 5, 2:21 AM (13 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2615621
Default Alt Text
D8271.id28609.diff (3 KB)
Attached To
Mode
D8271: [native] Unblock scrolling when continuing editing
Attached
Detach File
Event Timeline
Log In to Comment