@@ -143,14 +143,6 @@ function SearchRouterItem(props: UserListItemProps<OptionData> | SearchQueryList
143143 ) ;
144144}
145145
146- const ContinuationDetectionSearchFilterKey = [
147- CONST . SEARCH . SYNTAX_FILTER_KEYS . TO ,
148- CONST . SEARCH . SYNTAX_FILTER_KEYS . FROM ,
149- CONST . SEARCH . SYNTAX_FILTER_KEYS . ASSIGNEE ,
150- CONST . SEARCH . SYNTAX_FILTER_KEYS . PAYER ,
151- CONST . SEARCH . SYNTAX_FILTER_KEYS . EXPORTER ,
152- ] as SearchFilterKey [ ] ;
153-
154146function SearchAutocompleteList (
155147 {
156148 autocompleteQueryValue,
@@ -269,7 +261,15 @@ function SearchAutocompleteList(
269261 if ( ! autocomplete && ranges . length > 0 ) {
270262 const lastRange = ranges . at ( ranges . length - 1 ) ;
271263
272- if ( lastRange && ContinuationDetectionSearchFilterKey . includes ( lastRange . key ) ) {
264+ const continuationDetectionSearchFilterKey = [
265+ CONST . SEARCH . SYNTAX_FILTER_KEYS . TO ,
266+ CONST . SEARCH . SYNTAX_FILTER_KEYS . FROM ,
267+ CONST . SEARCH . SYNTAX_FILTER_KEYS . ASSIGNEE ,
268+ CONST . SEARCH . SYNTAX_FILTER_KEYS . PAYER ,
269+ CONST . SEARCH . SYNTAX_FILTER_KEYS . EXPORTER ,
270+ ] as SearchFilterKey [ ] ;
271+
272+ if ( lastRange && continuationDetectionSearchFilterKey . includes ( lastRange . key ) ) {
273273 const afterLastRange = autocompleteQueryValue . substring ( lastRange . start + lastRange . length ) ;
274274 const continuationMatch = afterLastRange . match ( / ^ \s + ( \w + ) / ) ;
275275
@@ -677,7 +677,14 @@ function SearchAutocompleteList(
677677 }
678678
679679 const fieldKey = focusedItem . mapKey ?. includes ( ':' ) ? focusedItem . mapKey . split ( ':' ) . at ( 0 ) : focusedItem . mapKey ;
680- const isNameField = fieldKey && ContinuationDetectionSearchFilterKey . includes ( fieldKey as SearchFilterKey ) ;
680+ const continuationDetectionSearchFilterKey = [
681+ CONST . SEARCH . SYNTAX_FILTER_KEYS . TO ,
682+ CONST . SEARCH . SYNTAX_FILTER_KEYS . FROM ,
683+ CONST . SEARCH . SYNTAX_FILTER_KEYS . ASSIGNEE ,
684+ CONST . SEARCH . SYNTAX_FILTER_KEYS . PAYER ,
685+ CONST . SEARCH . SYNTAX_FILTER_KEYS . EXPORTER ,
686+ ] as SearchFilterKey [ ] ;
687+ const isNameField = fieldKey && continuationDetectionSearchFilterKey . includes ( fieldKey as SearchFilterKey ) ;
681688
682689 let trimmedUserSearchQuery ;
683690 if ( isNameField && fieldKey ) {
0 commit comments