diff --git a/packages-content-model/roosterjs-content-model-editor/lib/publicApi/utils/formatWithContentModel.ts b/packages-content-model/roosterjs-content-model-editor/lib/publicApi/utils/formatWithContentModel.ts index 23bb89af75c..135725ceb86 100644 --- a/packages-content-model/roosterjs-content-model-editor/lib/publicApi/utils/formatWithContentModel.ts +++ b/packages-content-model/roosterjs-content-model-editor/lib/publicApi/utils/formatWithContentModel.ts @@ -145,12 +145,10 @@ function handleImages(editor: IContentModelEditor, context: FormatWithContentMod if (context.newImages.length > 0) { const viewport = editor.getVisibleViewport(); if (viewport) { - const { top, bottom, left, right } = viewport; + const { left, right } = viewport; const minMaxImageSize = 10; const maxWidth = Math.max(right - left, minMaxImageSize); - const maxHeight = Math.max(bottom - top, minMaxImageSize); context.newImages.forEach(image => { - image.format.maxHeight = `${maxHeight}px`; image.format.maxWidth = `${maxWidth}px`; }); } diff --git a/packages-content-model/roosterjs-content-model-editor/test/editor/plugins/paste/e2e/cmPasteFromExcelTest.ts b/packages-content-model/roosterjs-content-model-editor/test/editor/plugins/paste/e2e/cmPasteFromExcelTest.ts index 211f980f2a7..3c79c0625bd 100644 --- a/packages-content-model/roosterjs-content-model-editor/test/editor/plugins/paste/e2e/cmPasteFromExcelTest.ts +++ b/packages-content-model/roosterjs-content-model-editor/test/editor/plugins/paste/e2e/cmPasteFromExcelTest.ts @@ -70,7 +70,6 @@ describe(ID, () => { src: 'https://github.com/microsoft/roosterjs', format: { maxWidth: '100px', - maxHeight: '100px', }, dataset: {}, },