Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 0 additions & 67 deletions contributingGuides/INTERACTION_MANAGER.md

This file was deleted.

5 changes: 4 additions & 1 deletion src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ const CONST = {
ANIMATED_PROGRESS_BAR_DURATION: 750,
ANIMATION_IN_TIMING: 100,
COMPOSER_FOCUS_DELAY: 150,
MAX_TRANSITION_DURATION_MS: 1000,
ANIMATION_DIRECTION: {
IN: 'in',
OUT: 'out',
Expand Down Expand Up @@ -8258,6 +8257,10 @@ const CONST = {
ADD_EXPENSE_APPROVALS: 'addExpenseApprovals',
},

MODAL_EVENTS: {
CLOSED: 'modalClosed',
},

LIST_BEHAVIOR: {
REGULAR: 'regular',
INVERTED: 'inverted',
Expand Down
2 changes: 1 addition & 1 deletion src/components/EmojiPicker/EmojiPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function EmojiPicker({viewportOffsetTop, ref}: EmojiPickerProps) {

// It's possible that the anchor is inside an active modal (e.g., add emoji reaction in report context menu).
// So, we need to get the anchor position first before closing the active modal which will also destroy the anchor.
KeyboardUtils.dismiss({shouldSkipSafari: true}).then(() =>
KeyboardUtils.dismiss(true).then(() =>
calculateAnchorPosition(emojiPopoverAnchor?.current, anchorOriginValue).then((value) => {
close(() => {
onWillShow?.();
Expand Down
4 changes: 3 additions & 1 deletion src/components/Modal/BaseModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, {useCallback, useContext, useEffect, useMemo, useRef, useState} fr
import type {LayoutChangeEvent} from 'react-native';
// Animated required for side panel navigation
// eslint-disable-next-line no-restricted-imports
import {Animated, View} from 'react-native';
import {Animated, DeviceEventEmitter, View} from 'react-native';
import ColorSchemeWrapper from '@components/ColorSchemeWrapper';
import NavigationBar from '@components/NavigationBar';
import ScreenWrapperOfflineIndicatorContext from '@components/ScreenWrapper/ScreenWrapperOfflineIndicatorContext';
Expand Down Expand Up @@ -167,6 +167,8 @@ function BaseModal({
[],
);

useEffect(() => () => DeviceEventEmitter.emit(CONST.MODAL_EVENTS.CLOSED), []);

const handleShowModal = useCallback(() => {
if (shouldSetModalVisibility) {
setModalVisibility(true, type);
Expand Down
6 changes: 0 additions & 6 deletions src/components/Modal/ReanimatedModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import useThemeStyles from '@hooks/useThemeStyles';
import useWindowDimensions from '@hooks/useWindowDimensions';
import blurActiveElement from '@libs/Accessibility/blurActiveElement';
import getPlatform from '@libs/getPlatform';
import TransitionTracker from '@libs/Navigation/TransitionTracker';
import variables from '@styles/variables';
import CONST from '@src/CONST';
import Backdrop from './Backdrop';
Expand Down Expand Up @@ -103,7 +102,6 @@ function ReanimatedModal({
// eslint-disable-next-line @typescript-eslint/no-deprecated
InteractionManager.clearInteractionHandle(handleRef.current);
}
TransitionTracker.endTransition();

setIsVisibleState(false);
setIsContainerOpen(false);
Expand All @@ -116,15 +114,13 @@ function ReanimatedModal({
if (isVisible && !isContainerOpen && !isTransitioning) {
// eslint-disable-next-line @typescript-eslint/no-deprecated
handleRef.current = InteractionManager.createInteractionHandle();
TransitionTracker.startTransition();
onModalWillShow();

setIsVisibleState(true);
setIsTransitioning(true);
} else if (!isVisible && isContainerOpen && !isTransitioning) {
// eslint-disable-next-line @typescript-eslint/no-deprecated
handleRef.current = InteractionManager.createInteractionHandle();
TransitionTracker.startTransition();
onModalWillHide();

blurActiveElement();
Expand All @@ -145,7 +141,6 @@ function ReanimatedModal({
// eslint-disable-next-line @typescript-eslint/no-deprecated
InteractionManager.clearInteractionHandle(handleRef.current);
}
TransitionTracker.endTransition();
onModalShow();
}, [onModalShow]);

Expand All @@ -156,7 +151,6 @@ function ReanimatedModal({
// eslint-disable-next-line @typescript-eslint/no-deprecated
InteractionManager.clearInteractionHandle(handleRef.current);
}
TransitionTracker.endTransition();

// Because on Android, the Modal's onDismiss callback does not work reliably. There's a reported issue at:
// https://stackoverflow.com/questions/58937956/react-native-modal-ondismiss-not-invoked
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type {NavigatorScreenParams} from '@react-navigation/native';
import {useFocusEffect} from '@react-navigation/native';
import React, {useCallback, useMemo, useRef} from 'react';
import React, {useCallback, useEffect, useMemo, useRef} from 'react';
// eslint-disable-next-line no-restricted-imports
import {Animated, InteractionManager} from 'react-native';
import {Animated, DeviceEventEmitter, InteractionManager} from 'react-native';
import NoDropZone from '@components/DragAndDrop/NoDropZone';
import {MultifactorAuthenticationContextProviders} from '@components/MultifactorAuthentication/Context';
import {
Expand Down Expand Up @@ -169,6 +169,8 @@ function RightModalNavigator({navigation, route}: RightModalNavigatorProps) {
}, [syncRHPKeys, clearWideRHPKeysAfterTabChanged]),
);

useEffect(() => () => DeviceEventEmitter.emit(CONST.MODAL_EVENTS.CLOSED), []);

return (
<NarrowPaneContextProvider>
<MultifactorAuthenticationContextProviders>
Expand Down
Loading
Loading