Skip to content

Commit 06edeaa

Browse files
committed
MC-3560: Implement Editing Text Content Block from the Stage with WYSIWYG turned off completely or by default
Prevent assigning integer value to textarea height when its scroll height is same as minHeight. Prevents 60px assignment
1 parent 882cd56 commit 06edeaa

File tree

2 files changed

+18
-2
lines changed
  • app/code/Magento/PageBuilder/view/adminhtml/web

2 files changed

+18
-2
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/text/preview.js

Lines changed: 9 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/content-type/text/preview.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,14 @@ export default class Preview extends BasePreview {
106106
private adjustTextareaHeightBasedOnScrollHeight()
107107
{
108108
this.textarea.style.height = "";
109-
$(this.textarea).height(this.textarea.scrollHeight);
109+
110+
const scrollHeight = this.textarea.scrollHeight;
111+
const minHeight = parseInt($(this.textarea).css("min-height"), 10);
112+
113+
if (scrollHeight === minHeight) { // leave height at 'auto'
114+
return;
115+
}
116+
117+
$(this.textarea).height(scrollHeight);
110118
}
111119
}

0 commit comments

Comments
 (0)