Fix multiselect labels

only add values to new values if it is a new value
This commit is contained in:
Paul Chavard 2021-02-19 12:08:41 +01:00
parent a7331dd30d
commit 2c2b392d6c

View file

@ -107,7 +107,13 @@ function ComboMultipleDropdownList({
); );
const selectedValue = maybeValue && maybeValue[1]; const selectedValue = maybeValue && maybeValue[1];
if (value) { if (value) {
setNewValues([...newValues, selectedValue]); if (
acceptNewValues &&
extraOptions[0] &&
extraOptions[0][0] == selectedValue
) {
setNewValues([...newValues, selectedValue]);
}
saveSelection([...selections, selectedValue]); saveSelection([...selections, selectedValue]);
} }
setTerm(''); setTerm('');