Procházet zdrojové kódy

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

Aakansha Doshi před 3 roky
rodič
revize
25b529f519
1 změnil soubory, kde provedl 4 přidání a 1 odebrání
  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,