Parcourir la source

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

Aakansha Doshi il y a 3 ans
Parent
commit
25b529f519
1 fichiers modifiés avec 4 ajouts et 1 suppressions
  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,