|
1 | 1 | import lodashDebounce from 'lodash/debounce';
|
2 | 2 | import type {ForwardedRef} from 'react';
|
3 | 3 | import React, {forwardRef, useCallback, useEffect, useMemo, useRef, useState} from 'react';
|
4 |
| -import {findNodeHandle, InteractionManager, Keyboard, View} from 'react-native'; |
| 4 | +import {findNodeHandle, InteractionManager, View} from 'react-native'; |
5 | 5 | import type {MeasureInWindowOnSuccessCallback, NativeSyntheticEvent, TextInput, TextInputFocusEventData, TextInputKeyPressEventData, TextInputScrollEventData} from 'react-native';
|
6 | 6 | import {useFocusedInputHandler} from 'react-native-keyboard-controller';
|
7 | 7 | import {useOnyx} from 'react-native-onyx';
|
@@ -45,6 +45,7 @@ import setShouldShowComposeInputKeyboardAware from '@libs/setShouldShowComposeIn
|
45 | 45 | import CONST from '@src/CONST';
|
46 | 46 | import ONYXKEYS from '@src/ONYXKEYS';
|
47 | 47 | import type * as OnyxTypes from '@src/types/onyx';
|
| 48 | +import KeyboardUtils from '@src/utils/keyboard'; |
48 | 49 | import * as ReportActionContextMenu from './ContextMenu/ReportActionContextMenu';
|
49 | 50 | import getCursorPosition from './ReportActionCompose/getCursorPosition';
|
50 | 51 | import getScrollPosition from './ReportActionCompose/getScrollPosition';
|
@@ -255,9 +256,8 @@ function ReportActionItemMessageEdit(
|
255 | 256 |
|
256 | 257 | // Scroll to the last comment after editing to make sure the whole comment is clearly visible in the report.
|
257 | 258 | if (index === 0) {
|
258 |
| - const keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', () => { |
| 259 | + KeyboardUtils.dismiss().then(() => { |
259 | 260 | reportScrollManager.scrollToIndex(index, false);
|
260 |
| - keyboardDidHideListener.remove(); |
261 | 261 | });
|
262 | 262 | }
|
263 | 263 | }, [action, index, reportID, reportScrollManager, isActive]);
|
|
0 commit comments