diff --git a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/LanguageSelectField/LanguageSelectField.jsx b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/LanguageSelectField/LanguageSelectField.jsx index 0d5d7ebf..2d5b7adc 100644 --- a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/LanguageSelectField/LanguageSelectField.jsx +++ b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/LanguageSelectField/LanguageSelectField.jsx @@ -3,6 +3,7 @@ import { FieldLabel } from "react-invenio-forms"; import { LocalVocabularySelectField } from "@js/oarepo_vocabularies"; import { i18next } from "@translations/oarepo_ui/i18next"; import PropTypes from "prop-types"; +import { useFormConfig } from "@js/oarepo_ui"; export const LanguageSelectField = ({ fieldPath, @@ -16,6 +17,10 @@ export const LanguageSelectField = ({ value, ...uiProps }) => { + const { + formConfig: { default_locale }, + } = useFormConfig(); + return ( { formikProps.form.setFieldValue(fieldPath, data.value); }} - defaultValue="en" + defaultValue={multiple ? [default_locale] : default_locale} {...uiProps} /> );