@@ -76,6 +76,7 @@ function TaskAssigneeSelectorModal(props) {
76
76
const [ filteredPersonalDetails , setFilteredPersonalDetails ] = useState ( [ ] ) ;
77
77
const [ filteredUserToInvite , setFilteredUserToInvite ] = useState ( null ) ;
78
78
const [ filteredCurrentUserOption , setFilteredCurrentUserOption ] = useState ( null ) ;
79
+ const [ isLoading , setIsLoading ] = React . useState ( true ) ;
79
80
80
81
const updateOptions = useCallback ( ( ) => {
81
82
const { recentReports, personalDetails, userToInvite, currentUserOption} = OptionsListUtils . getNewChatOptions (
@@ -94,7 +95,10 @@ function TaskAssigneeSelectorModal(props) {
94
95
setFilteredRecentReports ( recentReports ) ;
95
96
setFilteredPersonalDetails ( personalDetails ) ;
96
97
setFilteredCurrentUserOption ( currentUserOption ) ;
97
- } , [ props , searchValue ] ) ;
98
+ if ( isLoading ) {
99
+ setIsLoading ( false ) ;
100
+ }
101
+ } , [ props , searchValue , isLoading ] ) ;
98
102
99
103
useEffect ( ( ) => {
100
104
const debouncedSearch = _ . debounce ( updateOptions , 200 ) ;
@@ -195,7 +199,7 @@ function TaskAssigneeSelectorModal(props) {
195
199
onChangeText = { onChangeText }
196
200
headerMessage = { headerMessage }
197
201
showTitleTooltip
198
- shouldShowOptions = { didScreenTransitionEnd }
202
+ shouldShowOptions = { didScreenTransitionEnd && ! isLoading }
199
203
textInputLabel = { props . translate ( 'optionsSelector.nameEmailOrPhoneNumber' ) }
200
204
safeAreaPaddingBottomStyle = { safeAreaPaddingBottomStyle }
201
205
/>
0 commit comments