fix: compute dimensions of container correctly when text pasted on container (#5845)

* fix: compute dimensions of container correctly when text pasted on container

* add test

* remove only
This commit is contained in:
Aakansha Doshi 2022-11-08 19:50:41 +05:30 committed by GitHub
parent e1c5c706c6
commit e201e79cd0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 71 additions and 7 deletions

View file

@ -169,8 +169,7 @@ const getAdjustedDimensions = (
let maxWidth = null;
const container = getContainerElement(element);
if (container) {
const containerDims = getContainerDims(container);
maxWidth = containerDims.width - BOUND_TEXT_PADDING * 2;
maxWidth = getMaxContainerWidth(container);
}
const {
width: nextWidth,
@ -258,7 +257,6 @@ export const refreshTextDimensions = (
) => {
const container = getContainerElement(textElement);
if (container) {
// text = wrapText(text, getFontString(textElement), container.width);
text = wrapText(
text,
getFontString(textElement),