Skip to content

Commit

Permalink
[Mappings editor] Fix bug when trying to clear the mapping field type (
Browse files Browse the repository at this point in the history
  • Loading branch information
sebelga authored Aug 31, 2020
1 parent 44a017b commit 2eb8e69
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,13 @@ export const TypeParameter = ({ isMultiField, isRootLevelField, showDocLink = fa
: filterTypesForNonRootFields(FIELD_TYPES_OPTIONS)
}
selectedOptions={typeField.value}
onChange={typeField.setValue}
onChange={(value) => {
if (value.length === 0) {
// Don't allow clearing the type. One must always be selected
return;
}
typeField.setValue(value);
}}
isClearable={false}
data-test-subj="fieldType"
/>
Expand Down

0 comments on commit 2eb8e69

Please sign in to comment.