Skip to content

Commit

Permalink
AKR(Frontend): Fix PublicTranslatorFilters [deploy]
Browse files Browse the repository at this point in the history
  • Loading branch information
pkoivisto committed Oct 23, 2023
1 parent e18994c commit 1426acb
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ export const PublicTranslatorFilters = ({
const getComboBoxAttributes = (fieldName: SearchFilter) => ({
onInputChange: handleComboboxInputChange(fieldName),
inputValue: inputValues[fieldName],
value: values[fieldName] as AutocompleteValue,
autoHighlight: true,
variant: TextFieldVariant.Outlined,
});
Expand Down Expand Up @@ -291,6 +290,14 @@ export const PublicTranslatorFilters = ({
<LanguageSelect
data-testid="public-translator-filters__from-language-select"
{...getComboBoxAttributes(SearchFilter.FromLang)}
value={
values.fromLang
? {
label: translateLanguage(values.fromLang),
value: values.fromLang,
}
: null
}
showError={hasError(SearchFilter.FromLang)}
label={t('languagePair.fromPlaceholder')}
placeholder={t('languagePair.fromPlaceholder')}
Expand All @@ -310,6 +317,14 @@ export const PublicTranslatorFilters = ({
<LanguageSelect
data-testid="public-translator-filters__to-language-select"
{...getComboBoxAttributes(SearchFilter.ToLang)}
value={
values.toLang
? {
label: translateLanguage(values.toLang),
value: values.toLang,
}
: null
}
showError={hasError(SearchFilter.ToLang)}
label={t('languagePair.toPlaceholder')}
placeholder={t('languagePair.toPlaceholder')}
Expand Down Expand Up @@ -345,6 +360,7 @@ export const PublicTranslatorFilters = ({
<ComboBox
data-testid="public-translator-filters__town-combobox"
{...getComboBoxAttributes(SearchFilter.Town)}
value={values.town ?? null}
placeholder={t('town.placeholder')}
label={t('town.placeholder')}
id="filters-town"
Expand Down

0 comments on commit 1426acb

Please sign in to comment.