Skip to content

Commit d3831cc

Browse files
authored
Merge pull request Expensify#87834 from Expensify/claude-fixSplitResetFocusBug
Blur active input before resetting split shares on iOS
2 parents c05060c + f77a295 commit d3831cc

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/components/MoneyRequestConfirmationList.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {useFocusEffect, useIsFocused} from '@react-navigation/native';
22
import React, {memo, useCallback, useEffect, useMemo, useRef, useState} from 'react';
3-
import {InteractionManager, View} from 'react-native';
3+
import {InteractionManager, Keyboard, View} from 'react-native';
44
import type {OnyxEntry} from 'react-native-onyx';
55
import {useCurrencyListActions} from '@hooks/useCurrencyList';
66
import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails';
@@ -663,6 +663,9 @@ function MoneyRequestConfirmationList({
663663
{!shouldShowReadOnlySplits && !!isSplitModified && (
664664
<PressableWithFeedback
665665
onPress={() => {
666+
// Dismiss the keyboard so that MoneyRequestAmountInput's useEffect syncs the new amount.
667+
// Without this, the effect skips the update while the input is focused (see formatAmountOnBlur guard).
668+
Keyboard.dismiss();
666669
resetSplitShares(transaction);
667670
}}
668671
accessibilityLabel={CONST.ROLE.BUTTON}

0 commit comments

Comments
 (0)