File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,9 +104,17 @@ export const AppHostedLanguageGroup: React.FunctionComponent = () => {
104104 getItemProps : ( options : GetItemPropsOptions < any > ) => { } ,
105105 getMenuProps : ( options : GetMenuPropsOptions ) => { }
106106 ) => {
107- languagesToDisplay = getLanguagesMatchingSearchTerm ( searchTerm ) . filter (
108- ( lang ) => preferredLangCodes . indexOf ( lang . isoCode ) < 0
109- ) ;
107+ const hasSearchTerm = ! ! searchTerm ?. trim ( ) ;
108+ const matchingLanguages = getLanguagesMatchingSearchTerm ( searchTerm ) ;
109+ // Historically we excluded favorites from the main list to avoid showing duplicates.
110+ // However, that makes it look like search is broken when the language you're typing
111+ // is already in the "Favorite languages" section (which is also hidden while typing).
112+ // In search mode, include favorites in results. BL-15822
113+ languagesToDisplay = hasSearchTerm
114+ ? matchingLanguages
115+ : matchingLanguages . filter (
116+ ( lang ) => preferredLangCodes . indexOf ( lang . isoCode ) < 0
117+ ) ;
110118 const prefColor = commonUI . colors . bloomRed ;
111119 // if (!showAll && languagesToDisplay.length > 10) {
112120 // languagesToDisplay.splice(10);
You can’t perform that action at this time.
0 commit comments