Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Remain focus when selecting option #20736

Merged
merged 14 commits into from
Jul 5, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import CONST from '../../../../CONST';
import withLocalize, {withLocalizePropTypes} from '../../../../components/withLocalize';
import compose from '../../../../libs/compose';
import personalDetailsPropType from '../../../personalDetailsPropType';
import * as Browser from '../../../../libs/Browser';
import reportPropTypes from '../../../reportPropTypes';

const propTypes = {
Expand Down Expand Up @@ -140,11 +141,8 @@ function MoneyRequestParticipantsSplitSelector({betas, participants, personalDet
personalDetails: chatOptions.personalDetails,
userToInvite: chatOptions.userToInvite,
});
if (!isOptionInList) {
setSearchTerm('');
}
},
[searchTerm, participants, onAddParticipants, reports, personalDetails, betas, setNewChatOptions, setSearchTerm],
[searchTerm, participants, onAddParticipants, reports, personalDetails, betas, setNewChatOptions],
);

const headerMessage = OptionsListUtils.getHeaderMessage(
Expand Down Expand Up @@ -181,6 +179,7 @@ function MoneyRequestParticipantsSplitSelector({betas, participants, personalDet
textInputLabel={translate('optionsSelector.nameEmailOrPhoneNumber')}
safeAreaPaddingBottomStyle={safeAreaPaddingBottomStyle}
shouldShowOptions={isOptionsDataReady}
shouldFocusOnSelectRow={!Browser.isMobile()}
/>
</View>
);
Expand Down