fix: text never goes beyond max width for unbound text elements (#6288)

This commit is contained in:
Aakansha Doshi 2023-02-27 16:54:29 +05:30 committed by GitHub
parent e1dc748aef
commit 38fc51b4e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 6 deletions

View file

@ -272,9 +272,9 @@ export const textWysiwyg = ({
: updatedTextElement.height / lines.length;
if (!container) {
maxWidth = (appState.width - 8 - viewportX) / appState.zoom.value;
}
// As firefox, Safari needs little higher dimensions on DOM
if (isFirefox || isSafari) {
textElementWidth = Math.min(textElementWidth, maxWidth);
} else if (isFirefox || isSafari) {
// As firefox, Safari needs little higher dimensions on DOM
textElementWidth += 0.5;
}
// Make sure text editor height doesn't go beyond viewport