Explorar o código

fix: vertically center align text when text deleted (#4457)

Aakansha Doshi %!s(int64=3) %!d(string=hai) anos
pai
achega
25b529f519
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      src/element/textWysiwyg.tsx

+ 4 - 1
src/element/textWysiwyg.tsx

@@ -109,7 +109,10 @@ export const textWysiwyg = ({
 
       let maxHeight = updatedElement.height;
       let width = updatedElement.width;
-      const height = Math.max(editable.scrollHeight, updatedElement.height);
+      const height =
+        editable.scrollHeight === 0
+          ? updatedElement.height
+          : editable.scrollHeight;
       if (container && updatedElement.containerId) {
         const propertiesUpdated = textPropertiesUpdated(
           updatedElement,