Fix input select to prevent case where no button is selected
@@ -90,8 +90,10 @@ const renderButton = (id, value, onChange) => input => (
}
onChange={() => {
if (Array.isArray(value)) {
- if (value.indexOf(input.key) > -1 && value.length > 1) {
+ if (value.indexOf(input.key) > -1) {
+ if (value.length > 1) {
onChange(value.filter(i => i !== input.key));
+ }
} else {
onChange([].concat(value, input.key));
}
