diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index 838257a8cdd8..0e5fffc41599 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -721,7 +721,9 @@ function getHeaderMessage(hasSelectableOptions, hasUserToInvite, searchValue, ma return translate(preferredLocale, 'messages.noPhoneNumber'); } - if (!hasSelectableOptions && !hasUserToInvite) { + // Without a search value, it would be very confusing to see a search validation message. + // Therefore, this skips the validation when there is no search value. + if (searchValue && !hasSelectableOptions && !hasUserToInvite) { if (/^\d+$/.test(searchValue)) { return translate(preferredLocale, 'messages.noPhoneNumber'); } diff --git a/src/pages/NewChatPage.js b/src/pages/NewChatPage.js index c21888389af0..2c5ac5676f51 100755 --- a/src/pages/NewChatPage.js +++ b/src/pages/NewChatPage.js @@ -123,7 +123,7 @@ class NewChatPage extends Component { render() { const sections = this.getSections(); const headerMessage = getHeaderMessage( - this.state.personalDetails.length !== 0, + this.state.personalDetails.length + this.state.recentReports.length !== 0, Boolean(this.state.userToInvite), this.state.searchValue, ); diff --git a/src/pages/iou/steps/IOUParticipantsPage/IOUParticipantsRequest.js b/src/pages/iou/steps/IOUParticipantsPage/IOUParticipantsRequest.js index ead69898fdad..a277528530cd 100755 --- a/src/pages/iou/steps/IOUParticipantsPage/IOUParticipantsRequest.js +++ b/src/pages/iou/steps/IOUParticipantsPage/IOUParticipantsRequest.js @@ -2,7 +2,7 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {withOnyx} from 'react-native-onyx'; import _ from 'underscore'; -import {getNewChatOptions, isCurrentUser} from '../../../../libs/OptionsListUtils'; +import {getHeaderMessage, getNewChatOptions, isCurrentUser} from '../../../../libs/OptionsListUtils'; import OptionsSelector from '../../../../components/OptionsSelector'; import ONYXKEYS from '../../../../ONYXKEYS'; import withLocalize, {withLocalizePropTypes} from '../../../../components/withLocalize'; @@ -115,6 +115,11 @@ class IOUParticipantsRequest extends Component { render() { const sections = this.getSections(); + const headerMessage = getHeaderMessage( + this.state.personalDetails.length + this.state.recentReports.length !== 0, + Boolean(this.state.userToInvite), + this.state.searchValue, + ); return ( @@ -230,6 +235,7 @@ class IOUParticipantsSplit extends Component { personalDetails, }); }} + headerMessage={headerMessage} disableArrowKeysActions hideAdditionalOptionStates forceTextUnreadStyle