Prechádzať zdrojové kódy

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

Aakansha Doshi 3 rokov pred
rodič
commit
25b529f519
1 zmenil súbory, kde vykonal 4 pridanie a 1 odobranie
  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,