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

This commit is contained in:
Aakansha Doshi 2021-12-22 00:07:55 +05:30 committed by GitHub
parent 8e6a747873
commit 25b529f519
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -109,7 +109,10 @@ export const textWysiwyg = ({
let maxHeight = updatedElement.height; let maxHeight = updatedElement.height;
let width = updatedElement.width; 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) { if (container && updatedElement.containerId) {
const propertiesUpdated = textPropertiesUpdated( const propertiesUpdated = textPropertiesUpdated(
updatedElement, updatedElement,