Skip to content

Commit

Permalink
Merge pull request #54276 from truph01/fix-53572
Browse files Browse the repository at this point in the history
fix: dismiss keyboard once open modal
  • Loading branch information
rlinoz authored Jan 10, 2025
2 parents c95f9fa + 96f26b9 commit 3322a30
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/Modal/BaseModal.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {PortalHost} from '@gorhom/portal';
import React, {forwardRef, useCallback, useEffect, useMemo, useRef} from 'react';
import {View} from 'react-native';
import {Keyboard, View} from 'react-native';
import ReactNativeModal from 'react-native-modal';
import ColorSchemeWrapper from '@components/ColorSchemeWrapper';
import FocusTrapForModal from '@components/FocusTrap/FocusTrapForModal';
Expand Down Expand Up @@ -105,6 +105,7 @@ function BaseModal(
let removeOnCloseListener: () => void;
if (isVisible) {
Modal.willAlertModalBecomeVisible(true, type === CONST.MODAL.MODAL_TYPE.POPOVER || type === CONST.MODAL.MODAL_TYPE.BOTTOM_DOCKED);
Keyboard.dismiss();
// To handle closing any modal already visible when this modal is mounted, i.e. PopoverReportActionContextMenu
removeOnCloseListener = Modal.setCloseModal(onClose);
}
Expand Down

0 comments on commit 3322a30

Please sign in to comment.