Fix value when multiple elements are selected (#571)
If you have two elements selected that have a different value (eg: a green line and a red line), the value of the color picker should be undefined, not the default value.
This commit is contained in:
parent
3e381b75cb
commit
ed42672fd3
@ -27,8 +27,9 @@ const getFormValue = function<T>(
|
|||||||
): T | null {
|
): T | null {
|
||||||
return (
|
return (
|
||||||
(editingElement && getAttribute(editingElement)) ??
|
(editingElement && getAttribute(editingElement)) ??
|
||||||
getCommonAttributeOfSelectedElements(elements, getAttribute) ??
|
(elements.some(element => element.isSelected)
|
||||||
defaultValue ??
|
? getCommonAttributeOfSelectedElements(elements, getAttribute)
|
||||||
|
: defaultValue) ??
|
||||||
null
|
null
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user