Explorar o código

fix: slider value resets to the default value when opacity is 0 (#516)

lissitz %!s(int64=5) %!d(string=hai) anos
pai
achega
3f1075cbcd
Modificáronse 1 ficheiros con 4 adicións e 4 borrados
  1. 4 4
      src/actions/actionProperties.tsx

+ 4 - 4
src/actions/actionProperties.tsx

@@ -26,9 +26,9 @@ const getFormValue = function<T>(
   defaultValue?: T
 ): T | null {
   return (
-    (editingElement && getAttribute(editingElement)) ||
-    getCommonAttributeOfSelectedElements(elements, getAttribute) ||
-    defaultValue ||
+    (editingElement && getAttribute(editingElement)) ??
+    getCommonAttributeOfSelectedElements(elements, getAttribute) ??
+    defaultValue ??
     null
   );
 };
@@ -211,7 +211,7 @@ export const actionChangeOpacity: Action = {
             elements,
             element => element.opacity,
             100 /* default opacity */
-          ) || undefined
+          ) ?? undefined
         }
       />
     </>