diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index 826c5886f70d..769fc86204c6 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -1006,9 +1006,10 @@ function getMemberInviteOptions(personalDetails, betas = [], searchValue = '', e * @param {Boolean} hasUserToInvite * @param {String} searchValue * @param {Boolean} [maxParticipantsReached] + * @param {Boolean} [hasMatchedParticipant] * @return {String} */ -function getHeaderMessage(hasSelectableOptions, hasUserToInvite, searchValue, maxParticipantsReached = false) { +function getHeaderMessage(hasSelectableOptions, hasUserToInvite, searchValue, maxParticipantsReached = false, hasMatchedParticipant = false) { if (maxParticipantsReached) { return Localize.translate(preferredLocale, 'common.maxParticipantsReached', {count: CONST.REPORT.MAXIMUM_PARTICIPANTS}); } @@ -1030,7 +1031,9 @@ function getHeaderMessage(hasSelectableOptions, hasUserToInvite, searchValue, ma if (/@/.test(searchValue) && !isValidEmail) { return Localize.translate(preferredLocale, 'messages.errorMessageInvalidEmail'); } - + if (hasMatchedParticipant && (isValidEmail || isValidPhone)) { + return ''; + } return Localize.translate(preferredLocale, 'common.noResultsFound'); } diff --git a/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSplitSelector.js b/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSplitSelector.js index 0c1376006271..cfa7c0a8678c 100755 --- a/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSplitSelector.js +++ b/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSplitSelector.js @@ -129,7 +129,7 @@ function MoneyRequestParticipantsSplitSelector({betas, participants, personalDet if (isOptionInList) { newSelectedOptions = _.reject(participants, (selectedOption) => selectedOption.accountID === option.accountID); } else { - newSelectedOptions = [...participants, {accountID: option.accountID, login: option.login, selected: true}]; + newSelectedOptions = [...participants, {accountID: option.accountID, login: option.login, selected: true, searchText: option.searchText}]; } onAddParticipants(newSelectedOptions); @@ -150,6 +150,7 @@ function MoneyRequestParticipantsSplitSelector({betas, participants, personalDet Boolean(newChatOptions.userToInvite), searchTerm, maxParticipantsReached, + _.some((participant) => participant.searchText.toLowerCase().includes(searchTerm.toLowerCase())), ); const isOptionsDataReady = ReportUtils.isReportDataReady() && OptionsListUtils.isPersonalDetailsReady(personalDetails);