Skip to content

Commit

Permalink
Merge pull request Expensify#42965 from suneox/40767-handle-edit-last…
Browse files Browse the repository at this point in the history
…-message

handle focus after edit report item
  • Loading branch information
thienlnam authored Jun 6, 2024
2 parents bb14c99 + 2c2e598 commit 478db52
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/pages/home/report/ReportActionItemMessageEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {ExpensiMark} from 'expensify-common';
import lodashDebounce from 'lodash/debounce';
import type {ForwardedRef} from 'react';
import React, {forwardRef, useCallback, useEffect, useMemo, useRef, useState} from 'react';
import {Keyboard, View} from 'react-native';
import {InteractionManager, Keyboard, View} from 'react-native';
import type {NativeSyntheticEvent, TextInput, TextInputFocusEventData, TextInputKeyPressEventData} from 'react-native';
import {useOnyx} from 'react-native-onyx';
import type {Emoji} from '@assets/emojis/types';
Expand Down Expand Up @@ -406,7 +406,11 @@ function ReportActionItemMessageEdit(
style={[styles.textInputCompose, styles.flex1, styles.bgTransparent]}
onFocus={() => {
setIsFocused(true);
reportScrollManager.scrollToIndex(index, true);
InteractionManager.runAfterInteractions(() => {
requestAnimationFrame(() => {
reportScrollManager.scrollToIndex(index, true);
});
});
setShouldShowComposeInputKeyboardAware(false);

// Clear active report action when another action gets focused
Expand Down

0 comments on commit 478db52

Please sign in to comment.