Skip to content

Commit 80c468d

Browse files
Merge pull request #1576 from Zhephyr54/fix-ModernTaxonomyPicker-lang
Fix ModernTaxonomyPicker used language by checking for supported term…
2 parents bb65540 + c0d2f53 commit 80c468d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/controls/modernTaxonomyPicker/ModernTaxonomyPicker.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ export function ModernTaxonomyPicker(props: IModernTaxonomyPickerProps): JSX.Ele
8080
taxonomyService.getTermStoreInfo()
8181
.then((termStoreInfo) => {
8282
setCurrentTermStoreInfo(termStoreInfo);
83-
const languageTag = props.context.pageContext.cultureInfo.currentUICultureName !== '' ?
83+
const languageTag = props.context.pageContext.cultureInfo.currentUICultureName !== '' && termStoreInfo.languageTags.includes(props.context.pageContext.cultureInfo.currentUICultureName) ?
8484
props.context.pageContext.cultureInfo.currentUICultureName :
85-
currentTermStoreInfo.defaultLanguageTag;
85+
termStoreInfo.defaultLanguageTag;
8686
setCurrentLanguageTag(languageTag);
8787
setSelectedOptions(Array.isArray(props.initialValues) ?
8888
props.initialValues.map(term => { return { ...term, languageTag: languageTag, termStoreInfo: termStoreInfo } as ITermInfo; }) :

0 commit comments

Comments
 (0)