Skip to content

Commit

Permalink
Added a comment for the searchValue check
Browse files Browse the repository at this point in the history
  • Loading branch information
Santhosh-Sellavel committed Sep 17, 2021
1 parent 3a3bbd2 commit 2845143
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/libs/OptionsListUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,8 @@ function getHeaderMessage(hasSelectableOptions, hasUserToInvite, searchValue, ma
return translate(preferredLocale, 'messages.noPhoneNumber');
}

// 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');
Expand Down

0 comments on commit 2845143

Please sign in to comment.