Skip to content

Commit 739a62b

Browse files
modern tax picker initialValues with unresolved props
1 parent 92b0b71 commit 739a62b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/controls/modernTaxonomyPicker/ModernTaxonomyPicker.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,12 @@ export function ModernTaxonomyPicker(props: IModernTaxonomyPickerProps) {
8080
taxonomyService.getTermStoreInfo()
8181
.then((termStoreInfo) => {
8282
setCurrentTermStoreInfo(termStoreInfo);
83-
setCurrentLanguageTag(props.context.pageContext.cultureInfo.currentUICultureName !== '' ?
83+
const languageTag = props.context.pageContext.cultureInfo.currentUICultureName !== '' ?
8484
props.context.pageContext.cultureInfo.currentUICultureName :
85-
currentTermStoreInfo.defaultLanguageTag);
85+
currentTermStoreInfo.defaultLanguageTag;
86+
setCurrentLanguageTag(languageTag);
8687
setSelectedOptions(Array.isArray(props.initialValues) ?
87-
props.initialValues.map(term => { return { ...term, languageTag: currentLanguageTag, termStoreInfo: currentTermStoreInfo } as ITermInfo; }) :
88+
props.initialValues.map(term => { return { ...term, languageTag: languageTag, termStoreInfo: termStoreInfo } as ITermInfo; }) :
8889
[]);
8990
});
9091
taxonomyService.getTermSetInfo(Guid.parse(props.termSetId))

0 commit comments

Comments
 (0)